diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-12 14:06:53 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-12 14:06:53 +0100 |
commit | 5b65773ec836a6086374657098bbcc55e74abd60 (patch) | |
tree | 0983e42cee97453e7286461da4f9e9dee4d8246c /menu.c | |
parent | 54a2e99c7b86cafa5ad350171f021589ef2a80df (diff) | |
download | vdr-5b65773ec836a6086374657098bbcc55e74abd60.tar.gz vdr-5b65773ec836a6086374657098bbcc55e74abd60.tar.bz2 |
Using timer priority to interrupt lower priority timer recording
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 19 |
1 files changed, 16 insertions, 3 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.46 2000/11/11 15:22:56 kls Exp $ + * $Id: menu.c 1.47 2000/11/12 13:03:35 kls Exp $ */ #include "menu.h" @@ -1817,7 +1817,7 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer) timer->SetRecording(true); Channels.SwitchTo(timer->channel, dvbApi); cRecording Recording(timer); - if (dvbApi->StartRecord(Recording.FileName())) + if (dvbApi->StartRecord(Recording.FileName(), Channels.GetByNumber(timer->channel)->ca, timer->priority)) Recording.WriteSummary(); Interface->DisplayRecording(dvbApi->Index(), true); } @@ -1863,8 +1863,9 @@ bool cRecordControls::Start(cTimer *Timer) cChannel *channel = Channels.GetByNumber(ch); if (channel) { - cDvbApi *dvbApi = cDvbApi::GetDvbApi(channel->ca); + cDvbApi *dvbApi = cDvbApi::GetDvbApi(channel->ca, Timer ? Timer->priority : DEFAULTPRIORITY); if (dvbApi) { + Stop(dvbApi); for (int i = 0; i < MAXDVBAPI; i++) { if (!RecordControls[i]) { RecordControls[i] = new cRecordControl(dvbApi, Timer); @@ -1891,6 +1892,18 @@ void cRecordControls::Stop(const char *InstantId) } } +void cRecordControls::Stop(cDvbApi *DvbApi) +{ + for (int i = 0; i < MAXDVBAPI; i++) { + if (RecordControls[i]) { + if (RecordControls[i]->Uses(DvbApi)) { + isyslog(LOG_INFO, "stopping recording on DVB device %d due to higher priority", DvbApi->Index() + 1); + RecordControls[i]->Stop(); + } + } + } +} + const char *cRecordControls::GetInstantId(const char *LastInstantId) { for (int i = 0; i < MAXDVBAPI; i++) { |