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 | |
parent | 393627abd5c44cc092d178b70d7fb09c676a3dee (diff) | |
download | vdr-f4c63964a898b78e3bbce17e4fdb8f13e78e3317.tar.gz vdr-f4c63964a898b78e3bbce17e4fdb8f13e78e3317.tar.bz2 |
A device can now detach all receivers for a given PID
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | device.c | 18 | ||||
-rw-r--r-- | device.h | 4 | ||||
-rw-r--r-- | dvbdevice.c | 11 |
5 files changed, 32 insertions, 4 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1416c473..db49edb1 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -283,6 +283,7 @@ Werner Fink <werner@suse.de> for pointing out that MAXDPIDS needs to be to 16 (8xAC3 + 8xDTS) for reporting a problem with ensuring there is a current audio track in case there is only one track + for enabling a device to detach all receivers for a given PID Rolf Hakenes <hakenes@hippomi.de> for providing 'libdtv' and adapting the EIT mechanisms to it @@ -3589,3 +3589,5 @@ Video Disk Recorder Revision History only data from one frame (thanks to Reinhard Nissl). - EPG events without a title now display "No title" instead of "(null)" (thanks to Rolf Ahrenberg). +- A device can now detach all receivers for a given PID, as is necessary, e.g., + for the bitstreamout plugin (thanks to Werner Fink). @@ -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) @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.57 2005/02/20 14:06:28 kls Exp $ + * $Id: device.h 1.58 2005/06/05 12:56:08 kls Exp $ */ #ifndef __DEVICE_H @@ -500,6 +500,8 @@ public: ///< Attaches the given receiver to this device. void Detach(cReceiver *Receiver); ///< Detaches the given receiver from this device. + void DetachAll(int Pid); + ///< Detaches all receivers from this device for this pid. }; /// Derived cDevice classes that can receive channels will have to provide diff --git a/dvbdevice.c b/dvbdevice.c index 3a3b19bd..88afdffa 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.129 2005/05/16 15:23:43 kls Exp $ + * $Id: dvbdevice.c 1.130 2005/06/05 13:05:55 kls Exp $ */ #include "dvbdevice.h" @@ -654,8 +654,10 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) if (On) { if (Handle->handle < 0) { Handle->handle = DvbOpen(DEV_DVB_DEMUX, CardIndex(), O_RDWR | O_NONBLOCK, true); - if (Handle->handle < 0) + if (Handle->handle < 0) { + LOG_ERROR; return false; + } } pesFilterParams.pid = Handle->pid; pesFilterParams.input = DMX_IN_FRONTEND; @@ -722,6 +724,10 @@ void cDvbDevice::TurnOffLiveMode(bool LiveView) // Turn off live PIDs: + DetachAll(pidHandles[ptAudio].pid); + DetachAll(pidHandles[ptVideo].pid); + DetachAll(pidHandles[ptPcr].pid); + DetachAll(pidHandles[ptTeletext].pid); DelPid(pidHandles[ptAudio].pid); DelPid(pidHandles[ptVideo].pid); DelPid(pidHandles[ptPcr].pid, ptPcr); @@ -891,6 +897,7 @@ void cDvbDevice::SetAudioTrackDevice(eTrackType Type) if (TrackId && TrackId->id) { if (IS_AUDIO_TRACK(Type)) { if (pidHandles[ptAudio].pid && pidHandles[ptAudio].pid != TrackId->id) { + DetachAll(pidHandles[ptAudio].pid); pidHandles[ptAudio].pid = TrackId->id; SetPid(&pidHandles[ptAudio], ptAudio, true); } |