From 0e310c57a4af9e3b3bc87816a60b01790e2c6b89 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 20 Aug 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.4.1-5=20-=20Replaced=20the=20"quick=20worka?= =?UTF-8?q?round=20for=20additional=20live=20audio=20PIDs"=20in=20=20=20cD?= =?UTF-8?q?vbDevice::SetChannelDevice()=20with=20an=20actual=20solution=20?= =?UTF-8?q?in=20=20=20cDvbDevice::SetAudioTrackDevice()=20in=20order=20to?= =?UTF-8?q?=20prevent=20sticky=20PIDs=20in=20CAMs,=20=20=20which=20caused?= =?UTF-8?q?=20long=20switching=20times=20or=20completely=20blank=20screens?= =?UTF-8?q?=20when=20switching=20=20=20between=20encrypted=20channels=20on?= =?UTF-8?q?=20the=20same=20transponder=20(reported=20by=20Tomas=20Berglund?= =?UTF-8?q?).=20-=20Adapted=20cThread::ThreadId()=20to=20recent=20kernels?= =?UTF-8?q?=20(thanks=20to=20Ville=20Skytt=C3=A4).=20-=20Added=20--remove-?= =?UTF-8?q?destination=20to=20the=20'cp'=20command=20for=20binaries=20in?= =?UTF-8?q?=20the=20Makefile=20to=20=20=20avoid=20a=20crash=20in=20case=20?= =?UTF-8?q?a=20new=20version=20is=20installed=20on=20a=20running=20system?= =?UTF-8?q?=20(suggested=20=20=20by=20Petri=20Hintukainen).=20-=20Fixed=20?= =?UTF-8?q?handling=20"Ca=20Info"=20in=20case=20the=20CAM=20sends=20this?= =?UTF-8?q?=20again=20if=20the=20smart=20card=20is=20=20=20replaced=20with?= =?UTF-8?q?=20a=20different=20one.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTORS | 7 +++++++ HISTORY | 14 ++++++++++++++ Makefile | 6 +++--- ci.c | 12 +++++++----- config.h | 4 ++-- dvbdevice.c | 13 +++++++------ thread.c | 6 ++---- 7 files changed, 42 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f19b461..ea619ca 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1626,6 +1626,7 @@ Ville Skytt thread.c caused a compiler warning with g++ 4.1.1 for fixing converting the port number in the "connect from..." log message of SVDRP for reporting that there are places where ntohs() is assigned to different types + for adapting cThread::ThreadId() to recent kernels Steffen Beyer for fixing setting the colored button help after deleting a recording in case the next @@ -1808,6 +1809,8 @@ Gavin Hamill Petri Hintukainen for suggesting to disable the use of "fadvise" in cUnbufferedFile because there have been several reports that it causes more problems than it solves + for suggesting to add --remove-destination to the 'cp' command for binaries in + the Makefile to avoid a crash in case a new version is installed on a running system Marcel Schaeben for his "Easy Input" patch @@ -1980,3 +1983,7 @@ Frank Schmirler Jörn Reder for reporting that a recording may unnecessarily block a device with a CAM, while it could record on the primary device as well + +Tomas Berglund + for reporting a problem with sticky PIDs in CAMs when switching between encrypted + channels on the same transponder diff --git a/HISTORY b/HISTORY index 6ba80d3..29ba1e2 100644 --- a/HISTORY +++ b/HISTORY @@ -4874,3 +4874,17 @@ Video Disk Recorder Revision History Oliver Endriss). - Added a log error message to cPlugin::ConfigDirectory() in case a plugin calls it from a separate thread (reported by Udo Richter). + +2006-08-20: Version 1.4.1-5 + +- Replaced the "quick workaround for additional live audio PIDs" in + cDvbDevice::SetChannelDevice() with an actual solution in + cDvbDevice::SetAudioTrackDevice() in order to prevent sticky PIDs in CAMs, + which caused long switching times or completely blank screens when switching + between encrypted channels on the same transponder (reported by Tomas Berglund). +- Adapted cThread::ThreadId() to recent kernels (thanks to Ville Skyttä). +- Added --remove-destination to the 'cp' command for binaries in the Makefile to + avoid a crash in case a new version is installed on a running system (suggested + by Petri Hintukainen). +- Fixed handling "Ca Info" in case the CAM sends this again if the smart card is + replaced with a different one. diff --git a/Makefile b/Makefile index 0a3dffa..1d73b79 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 1.94 2006/06/02 14:45:33 kls Exp $ +# $Id: Makefile 1.95 2006/08/20 10:44:22 kls Exp $ .DELETE_ON_ERROR: @@ -201,7 +201,7 @@ install: install-bin install-conf install-doc install-plugins install-bin: vdr @mkdir -p $(BINDIR) - @cp vdr runvdr $(BINDIR) + @cp --remove-destination vdr runvdr $(BINDIR) # Configuration files: @@ -223,7 +223,7 @@ install-doc: install-plugins: plugins @mkdir -p $(PLUGINLIBDIR) - @cp $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(PLUGINLIBDIR) + @cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(PLUGINLIBDIR) # Source documentation: diff --git a/ci.c b/ci.c index d1332dd..066acc2 100644 --- a/ci.c +++ b/ci.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 1.44 2006/08/12 10:14:27 kls Exp $ + * $Id: ci.c 1.45 2006/08/20 11:38:33 kls Exp $ */ #include "ci.h" @@ -985,6 +985,7 @@ bool cCiConditionalAccessSupport::Process(int Length, const uint8_t *Data) switch (Tag) { case AOT_CA_INFO: { dbgprotocol("%d: <== Ca Info", SessionId()); + numCaSystemIds = 0; int l = 0; const uint8_t *d = GetData(Data, l); while (l > 1) { @@ -992,13 +993,14 @@ bool cCiConditionalAccessSupport::Process(int Length, const uint8_t *Data) dbgprotocol(" %04X", id); d += 2; l -= 2; - if (numCaSystemIds < MAXCASYSTEMIDS) { + if (numCaSystemIds < MAXCASYSTEMIDS) caSystemIds[numCaSystemIds++] = id; - caSystemIds[numCaSystemIds] = 0; - } - else + else { esyslog("ERROR: too many CA system IDs!"); + break; + } } + caSystemIds[numCaSystemIds] = 0; dbgprotocol("\n"); } state = 2; // got ca info diff --git a/config.h b/config.h index 82c06c6..8472210 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.265 2006/08/12 09:10:11 kls Exp $ + * $Id: config.h 1.266 2006/08/14 09:49:22 kls Exp $ */ #ifndef __CONFIG_H @@ -21,7 +21,7 @@ // VDR's own version number: -#define VDRVERSION "1.4.1-4" +#define VDRVERSION "1.4.1-5" #define VDRVERSNUM 10401 // Version * 10000 + Major * 100 + Minor // The plugin API's version number: diff --git a/dvbdevice.c b/dvbdevice.c index 9ae8dfa..fb8ec93 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.159 2006/06/11 09:03:55 kls Exp $ + * $Id: dvbdevice.c 1.160 2006/08/14 09:38:32 kls Exp $ */ #include "dvbdevice.h" @@ -853,11 +853,6 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->Number(), CardIndex() + 1); return false; } - //XXX quick workaround for additional live audio PIDs: - if (ciHandler) { - ciHandler->SetPid(Channel->Apid(1), true); - ciHandler->SetPid(Channel->Dpid(0), true); - } if (IsPrimaryDevice()) AddPid(Channel->Tpid(), ptTeletext); CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, true)); // actually one would expect 'false' here, but according to Marco Schlüßler this works @@ -927,8 +922,14 @@ void cDvbDevice::SetAudioTrackDevice(eTrackType Type) if (IS_AUDIO_TRACK(Type) || (IS_DOLBY_TRACK(Type) && SetAudioBypass(true))) { if (pidHandles[ptAudio].pid && pidHandles[ptAudio].pid != TrackId->id) { DetachAll(pidHandles[ptAudio].pid); + if (ciHandler) + ciHandler->SetPid(pidHandles[ptAudio].pid, false); pidHandles[ptAudio].pid = TrackId->id; SetPid(&pidHandles[ptAudio], ptAudio, true); + if (ciHandler) { + ciHandler->SetPid(pidHandles[ptAudio].pid, true); + ciHandler->StartDecrypting(); + } } } else if (IS_DOLBY_TRACK(Type)) { diff --git a/thread.c b/thread.c index 1749fc1..8b6e58f 100644 --- a/thread.c +++ b/thread.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.c 1.56 2006/06/24 10:10:58 kls Exp $ + * $Id: thread.c 1.57 2006/08/20 10:20:44 kls Exp $ */ #include "thread.h" @@ -316,11 +316,9 @@ bool cThread::EmergencyExit(bool Request) return emergencyExitRequested = true; // yes, it's an assignment, not a comparison! } -_syscall0(pid_t, gettid) - tThreadId cThread::ThreadId(void) { - return gettid(); + return syscall(__NR_gettid); } void cThread::SetMainThreadId(void) -- cgit v1.2.3