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
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.

View File

@ -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);

View File

@ -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;