diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-03-20 11:19:36 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-03-20 11:19:36 +0100 |
commit | ce0e97eb6501ecea1c6be45bcc99ce51d34262c9 (patch) | |
tree | 1fc0271f185b2b7961463aff2f2eb95c37121936 /menu.c | |
parent | e760b14f646004a7fe99e4561156a132a0572cdb (diff) | |
download | vdr-ce0e97eb6501ecea1c6be45bcc99ce51d34262c9.tar.gz vdr-ce0e97eb6501ecea1c6be45bcc99ce51d34262c9.tar.bz2 |
Single shot timers are now reliably deleted when they have expired
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.345 2005/03/19 15:45:19 kls Exp $ + * $Id: menu.c 1.346 2005/03/20 11:06:56 kls Exp $ */ #include "menu.h" @@ -3067,7 +3067,7 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause) cRecordControl::~cRecordControl() { - Stop(true); + Stop(); free(instantId); free(fileName); } @@ -3102,16 +3102,11 @@ bool cRecordControl::GetEvent(void) return false; } -void cRecordControl::Stop(bool KeepInstant) +void cRecordControl::Stop(void) { if (timer) { DELETENULL(recorder); timer->SetRecording(false); - if ((IsInstant() && !KeepInstant) || (timer->IsSingleEvent() && timer->StopTime() <= time(NULL))) { - isyslog("deleting timer %d", timer->Index() + 1); - Timers.Del(timer); - Timers.SetModified(); - } timer = NULL; cStatus::MsgRecording(device, NULL); cRecordingUserCommand::InvokeCommand(RUC_AFTERRECORDING, fileName); @@ -3172,8 +3167,16 @@ void cRecordControls::Stop(const char *InstantId) for (int i = 0; i < MAXRECORDCONTROLS; i++) { if (RecordControls[i]) { const char *id = RecordControls[i]->InstantId(); - if (id && strcmp(id, InstantId) == 0) + if (id && strcmp(id, InstantId) == 0) { + cTimer *timer = RecordControls[i]->Timer(); RecordControls[i]->Stop(); + if (timer) { + isyslog("deleting timer %d", timer->Index() + 1); + Timers.Del(timer); + Timers.SetModified(); + } + break; + } } } } @@ -3184,7 +3187,7 @@ void cRecordControls::Stop(cDevice *Device) if (RecordControls[i]) { if (RecordControls[i]->Device() == Device) { isyslog("stopping recording on DVB device %d due to higher priority", Device->CardIndex() + 1); - RecordControls[i]->Stop(true); + RecordControls[i]->Stop(); } } } @@ -3261,7 +3264,7 @@ void cRecordControls::ChannelDataModified(cChannel *Channel) if (RecordControls[i]->Timer() && RecordControls[i]->Timer()->Channel() == Channel) { if (RecordControls[i]->Device()->ProvidesTransponder(Channel)) { // avoids retune on devices that don't really access the transponder isyslog("stopping recording due to modification of channel %d", Channel->Number()); - RecordControls[i]->Stop(true); + RecordControls[i]->Stop(); // This will restart the recording, maybe even from a different // device in case conditional access has changed. } |