diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-06-05 13:37:37 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-06-05 13:37:37 +0200 |
commit | f4c63964a898b78e3bbce17e4fdb8f13e78e3317 (patch) | |
tree | 80bb3a4271753761a960636bc1d45634f0f20f7a /device.c | |
parent | 393627abd5c44cc092d178b70d7fb09c676a3dee (diff) | |
download | vdr-f4c63964a898b78e3bbce17e4fdb8f13e78e3317.tar.gz vdr-f4c63964a898b78e3bbce17e4fdb8f13e78e3317.tar.bz2 |
A device can now detach all receivers for a given PID
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.101 2005/05/07 15:04:17 kls Exp $ + * $Id: device.c 1.102 2005/06/05 13:28:03 kls Exp $ */ #include "device.h" @@ -397,6 +397,8 @@ bool cDevice::AddPid(int Pid, ePidType PidType) PRINTPIDS("A"); if (!SetPid(&pidHandles[n], n, true)) { esyslog("ERROR: can't set PID %d on device %d", Pid, CardIndex() + 1); + if (PidType <= ptTeletext) + DetachAll(Pid); DelPid(Pid, PidType); return false; } @@ -422,6 +424,8 @@ bool cDevice::AddPid(int Pid, ePidType PidType) PRINTPIDS("C"); if (!SetPid(&pidHandles[n], n, true)) { esyslog("ERROR: can't set PID %d on device %d", Pid, CardIndex() + 1); + if (PidType <= ptTeletext) + DetachAll(Pid); DelPid(Pid, PidType); return false; } @@ -1211,6 +1215,18 @@ void cDevice::Detach(cReceiver *Receiver) } } +void cDevice::DetachAll(int Pid) +{ + if (Pid) { + cMutexLock MutexLock(&mutexReceiver); + for (int i = 0; i < MAXRECEIVERS; i++) { + cReceiver *Receiver = receiver[i]; + if (Receiver && Receiver->WantsPid(Pid)) + Detach(Receiver); + } + } +} + // --- cTSBuffer ------------------------------------------------------------- cTSBuffer::cTSBuffer(int File, int Size, int CardIndex) |