From a6c1babf9a2827cf91c6c3b9809612927c890317 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 2 May 2003 14:30:03 +0200 Subject: [PATCH] Now turning off live PIDs when replaying --- HISTORY | 3 +++ dvbdevice.c | 42 ++++++++++++++++++++++++------------------ dvbdevice.h | 3 ++- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/HISTORY b/HISTORY index 096d47f8..eb371a5c 100644 --- a/HISTORY +++ b/HISTORY @@ -2095,3 +2095,6 @@ Video Disk Recorder Revision History - Fixed double call to MainMenuAction() of a plugin if invoked via a hotkey (thanks to Kai Moeller for reporting this one). - Fixed handling dedicated keys. +- Now turning off live PIDs when replaying. This avoids short spikes from other + channels when switching between Transfer Mode channels, and also lets an ongoing + replay continue even if a recording is started on the primary card. diff --git a/dvbdevice.c b/dvbdevice.c index f80f4d17..0c70e5bc 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.57 2003/05/02 09:12:20 kls Exp $ + * $Id: dvbdevice.c 1.58 2003/05/02 12:24:04 kls Exp $ */ #include "dvbdevice.h" @@ -567,6 +567,24 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) return true; } +void cDvbDevice::TurnOffLiveMode(void) +{ + // Avoid noise while switching: + + CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, true)); + CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true)); + CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER)); + CHECK(ioctl(fd_video, VIDEO_CLEAR_BUFFER)); + + // Turn off live PIDs: + + DelPid(pidHandles[ptAudio].pid); + DelPid(pidHandles[ptVideo].pid); + DelPid(pidHandles[ptPcr].pid, ptPcr); + DelPid(pidHandles[ptTeletext].pid); + DelPid(pidHandles[ptDolby].pid); +} + bool cDvbDevice::ProvidesSource(int Source) const { int type = Source & cSource::st_Mask; @@ -649,23 +667,8 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) // Turn off live PIDs if necessary: - if (TurnOffLivePIDs) { - - // Avoid noise while switching: - - CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, true)); - CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true)); - CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER)); - CHECK(ioctl(fd_video, VIDEO_CLEAR_BUFFER)); - - // Turn off live PIDs: - - DelPid(pidHandles[ptAudio].pid); - DelPid(pidHandles[ptVideo].pid); - DelPid(pidHandles[ptPcr].pid, ptPcr); - DelPid(pidHandles[ptTeletext].pid); - DelPid(pidHandles[ptDolby].pid); - } + if (TurnOffLivePIDs) + TurnOffLiveMode(); dvbTuner->Set(Channel, DoTune); if (DoTune) { @@ -783,6 +786,9 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode) siProcessor->SetStatus(true); break; case pmAudioVideo: + if (playMode == pmNone) + TurnOffLiveMode(); + // continue with next... case pmAudioOnlyBlack: if (siProcessor) siProcessor->SetStatus(false); diff --git a/dvbdevice.h b/dvbdevice.h index 335a6943..6bcbc724 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.20 2002/12/15 14:45:29 kls Exp $ + * $Id: dvbdevice.h 1.21 2003/05/02 12:21:51 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -59,6 +59,7 @@ public: private: cDvbTuner *dvbTuner; + void TurnOffLiveMode(void); public: virtual bool ProvidesSource(int Source) const; virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;