mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed a crash when deleting a recording that is currently being replayed
This commit is contained in:
parent
031bbcef40
commit
a9bd3ca0dc
3
HISTORY
3
HISTORY
@ -8828,7 +8828,7 @@ Video Disk Recorder Revision History
|
|||||||
- Empty adaptation field TS packets are now skipped when recording (thanks to
|
- Empty adaptation field TS packets are now skipped when recording (thanks to
|
||||||
Christopher Reimer, based on the "AFFcleaner" by Stefan Pöschel).
|
Christopher Reimer, based on the "AFFcleaner" by Stefan Pöschel).
|
||||||
|
|
||||||
2016-12-09: Version 2.3.2
|
2016-12-11: Version 2.3.2
|
||||||
|
|
||||||
- Fixed a crash when deleting a recording (reported by Oliver Endriss).
|
- Fixed a crash when deleting a recording (reported by Oliver Endriss).
|
||||||
- Fixed an overflow of PIDs in a receiver (thanks to Robert Hannebauer).
|
- Fixed an overflow of PIDs in a receiver (thanks to Robert Hannebauer).
|
||||||
@ -8846,3 +8846,4 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed a crash when trying to delete a channel that is being used by a timer.
|
- Fixed a crash when trying to delete a channel that is being used by a timer.
|
||||||
- Fixed setting the current item and counter values in the Recordings menu after
|
- Fixed setting the current item and counter values in the Recordings menu after
|
||||||
deleting the last recording in a subfolder.
|
deleting the last recording in a subfolder.
|
||||||
|
- Fixed a crash when deleting a recording that is currently being replayed.
|
||||||
|
29
menu.c
29
menu.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: menu.c 4.16 2016/12/09 14:54:24 kls Exp $
|
* $Id: menu.c 4.17 2016/12/11 12:43:55 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -3089,29 +3089,24 @@ eOSState cMenuRecordings::Delete(void)
|
|||||||
else
|
else
|
||||||
return osContinue;
|
return osContinue;
|
||||||
}
|
}
|
||||||
cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey);
|
cString FileName;
|
||||||
Recordings->SetExplicitModify();
|
{
|
||||||
cRecording *Recording = Recordings->GetByName(ri->Recording()->FileName());
|
LOCK_RECORDINGS_READ;
|
||||||
if (!Recording) {
|
if (const cRecording *Recording = Recordings->GetByName(ri->Recording()->FileName())) {
|
||||||
Skins.Message(mtWarning, tr("Recording vanished!"));
|
FileName = Recording->FileName();
|
||||||
recordingsStateKey.Remove();
|
|
||||||
return osContinue;
|
|
||||||
}
|
|
||||||
cString FileName = Recording->FileName();
|
|
||||||
if (RecordingsHandler.GetUsage(FileName)) {
|
if (RecordingsHandler.GetUsage(FileName)) {
|
||||||
if (Interface->Confirm(tr("Recording is being edited - really delete?"))) {
|
if (Interface->Confirm(tr("Recording is being edited - really delete?")))
|
||||||
RecordingsHandler.Del(FileName);
|
RecordingsHandler.Del(FileName);
|
||||||
Recording = Recordings->GetByName(FileName); // RecordingsHandler.Del() might have deleted it if it was the edited version
|
else
|
||||||
// we continue with the code below even if Recording is NULL,
|
|
||||||
// in order to have the menu updated etc.
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
recordingsStateKey.Remove();
|
|
||||||
return osContinue;
|
return osContinue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (cReplayControl::NowReplaying() && strcmp(cReplayControl::NowReplaying(), FileName) == 0)
|
if (cReplayControl::NowReplaying() && strcmp(cReplayControl::NowReplaying(), FileName) == 0)
|
||||||
cControl::Shutdown();
|
cControl::Shutdown();
|
||||||
|
cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey);
|
||||||
|
Recordings->SetExplicitModify();
|
||||||
|
cRecording *Recording = Recordings->GetByName(FileName);
|
||||||
if (!Recording || Recording->Delete()) {
|
if (!Recording || Recording->Delete()) {
|
||||||
cReplayControl::ClearLastReplayed(FileName);
|
cReplayControl::ClearLastReplayed(FileName);
|
||||||
Recordings->DelByName(FileName);
|
Recordings->DelByName(FileName);
|
||||||
|
Loading…
Reference in New Issue
Block a user