From 2f49224c9c9bf1e3c8595137894977aef6ef0cca Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 15 Nov 2002 14:04:11 +0100 Subject: Fixed closing unused PID handles --- CONTRIBUTORS | 3 +++ HISTORY | 4 +++- dvbdevice.c | 13 ++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6463c532..4310db77 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -466,3 +466,6 @@ Steffen Barszus Peter Seyringer for reporting a bug in saving the polarization parameter of channels that have a number in the 'source' parameter + +Stefan Schluenss + for reporting a bug where PID handles were not closed correctly diff --git a/HISTORY b/HISTORY index a9da2339..b3f356ce 100644 --- a/HISTORY +++ b/HISTORY @@ -1768,6 +1768,8 @@ Video Disk Recorder Revision History - Fixed a compiler warning regarding cMenuChannels::Del() and MenuTimers::Del() hiding the base class virtual functions. -2002-11-11: Version 1.1.17 +2002-11-15: Version 1.1.17 - Added new entries to 'ca.conf'. +- Fixed closing unused PID handles (thanks to Stefan Schluenss for reporting this + one). diff --git a/dvbdevice.c b/dvbdevice.c index 119a28e6..c519266e 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.35 2002/11/10 12:57:17 kls Exp $ + * $Id: dvbdevice.c 1.36 2002/11/15 13:53:41 kls Exp $ */ #include "dvbdevice.h" @@ -311,11 +311,11 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) pesFilterParams.pes_type= PesTypes[Type]; pesFilterParams.flags = DMX_IMMEDIATE_START; CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams)); - close(Handle->handle); - Handle->handle = -1; if (PesTypes[Type] == DMX_PES_VIDEO) // let's only do this once SetPlayMode(pmNone); // necessary to switch a PID from DMX_PES_VIDEO/AUDIO to DMX_PES_OTHER } + close(Handle->handle); + Handle->handle = -1; } } return true; @@ -393,10 +393,9 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) bool TurnOffLivePIDs = HasDecoder() && (DoTune || IsEncrypted && pidHandles[ptVideo].pid != Channel->Vpid() // CA channels can only be decrypted in "live" mode - || IsPrimaryDevice() - && (LiveView // for a new live view the old PIDs need to be turned off - || pidHandles[ptVideo].pid == Channel->Vpid() // for recording the PIDs must be shifted from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER - ) + || !IsPrimaryDevice() + || LiveView // for a new live view the old PIDs need to be turned off + || pidHandles[ptVideo].pid == Channel->Vpid() // for recording the PIDs must be shifted from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER ); bool StartTransferMode = IsPrimaryDevice() && !IsEncrypted && !DoTune -- cgit v1.2.3