1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Now turning off live PIDs when replaying

This commit is contained in:
Klaus Schmidinger 2003-05-02 14:30:03 +02:00
parent 6ffb7912d8
commit a6c1babf9a
3 changed files with 29 additions and 19 deletions

View File

@ -2095,3 +2095,6 @@ Video Disk Recorder Revision History
- Fixed double call to MainMenuAction() of a plugin if invoked via a hotkey (thanks - Fixed double call to MainMenuAction() of a plugin if invoked via a hotkey (thanks
to Kai Moeller for reporting this one). to Kai Moeller for reporting this one).
- Fixed handling dedicated keys. - 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.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbdevice.h"
@ -567,6 +567,24 @@ bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
return true; 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 bool cDvbDevice::ProvidesSource(int Source) const
{ {
int type = Source & cSource::st_Mask; int type = Source & cSource::st_Mask;
@ -649,23 +667,8 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Turn off live PIDs if necessary: // Turn off live PIDs if necessary:
if (TurnOffLivePIDs) { if (TurnOffLivePIDs)
TurnOffLiveMode();
// 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);
}
dvbTuner->Set(Channel, DoTune); dvbTuner->Set(Channel, DoTune);
if (DoTune) { if (DoTune) {
@ -783,6 +786,9 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
siProcessor->SetStatus(true); siProcessor->SetStatus(true);
break; break;
case pmAudioVideo: case pmAudioVideo:
if (playMode == pmNone)
TurnOffLiveMode();
// continue with next...
case pmAudioOnlyBlack: case pmAudioOnlyBlack:
if (siProcessor) if (siProcessor)
siProcessor->SetStatus(false); siProcessor->SetStatus(false);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBDEVICE_H
@ -59,6 +59,7 @@ public:
private: private:
cDvbTuner *dvbTuner; cDvbTuner *dvbTuner;
void TurnOffLiveMode(void);
public: public:
virtual bool ProvidesSource(int Source) const; virtual bool ProvidesSource(int Source) const;
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const; virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;