From 2cae2ed28c0b6055b504e6fd00a79bba176d0637 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 11 Nov 2005 16:13:19 +0100 Subject: Modified switching to Dolby Digital audio in live mode --- CONTRIBUTORS | 2 ++ HISTORY | 5 +++++ dvbdevice.c | 11 +++++++++-- dvbdevice.h | 4 +++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 42a76a92..c3b50b17 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -290,6 +290,8 @@ Werner Fink for reporting a problem with ensuring there is a current audio track in case there is only one track for enabling a device to detach all receivers for a given PID + for modifying switching to Dolby Digital audio in live mode, if the driver + and firmware can handle live DD without the need of a Transfer Mode Rolf Hakenes for providing 'libdtv' and adapting the EIT mechanisms to it diff --git a/HISTORY b/HISTORY index 1d73209f..a9517f26 100644 --- a/HISTORY +++ b/HISTORY @@ -3947,3 +3947,8 @@ Video Disk Recorder Revision History repeating timer (thanks to Marco Schlüßler). - No longer removing superfluous hyphens in EPG data - would become too language dependent to handle all kinds of exceptions. +- Modified switching to Dolby Digital audio in live mode, if the driver + and firmware can handle live DD without the need of a Transfer Mode (thanks + to Werner Fink). Live DD mode requires a full featured DVB card and a + LinuxDVB driver with firmware version 0x2622 or higher. Older versions will + use Transfer Mode just like before. diff --git a/dvbdevice.c b/dvbdevice.c index 3f9e144e..b59076cd 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.136 2005/08/21 09:17:20 kls Exp $ + * $Id: dvbdevice.c 1.137 2005/11/11 14:53:52 kls Exp $ */ #include "dvbdevice.h" @@ -659,6 +659,11 @@ eVideoSystem cDvbDevice::GetVideoSystem(void) return VideoSystem; } +bool cDvbDevice::SetAudioBypass(bool On) +{ + return ioctl(fd_audio, AUDIO_SET_BYPASS_MODE, On) == 0; +} + // ptAudio ptVideo ptPcr ptTeletext ptDolby ptOther dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_PCR, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER }; @@ -841,6 +846,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) // PID settings: if (TurnOnLivePIDs) { + SetAudioBypass(false); if (!(AddPid(Channel->Ppid(), ptPcr) && AddPid(Channel->Vpid(), ptVideo) && AddPid(Channel->Apid(0), ptAudio))) { esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->Number(), CardIndex() + 1); return false; @@ -910,7 +916,8 @@ void cDvbDevice::SetAudioTrackDevice(eTrackType Type) { const tTrackId *TrackId = GetTrack(Type); if (TrackId && TrackId->id) { - if (IS_AUDIO_TRACK(Type)) { + SetAudioBypass(false); + if (IS_AUDIO_TRACK(Type) || (IS_DOLBY_TRACK(Type) && SetAudioBypass(true))) { if (pidHandles[ptAudio].pid && pidHandles[ptAudio].pid != TrackId->id) { DetachAll(pidHandles[ptAudio].pid); pidHandles[ptAudio].pid = TrackId->id; diff --git a/dvbdevice.h b/dvbdevice.h index 7da7e4f1..ed0cef8a 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.35 2005/08/20 15:20:15 kls Exp $ + * $Id: dvbdevice.h 1.36 2005/11/11 14:51:38 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -69,6 +69,8 @@ public: // PID handle facilities +private: + bool SetAudioBypass(bool On); protected: virtual bool SetPid(cPidHandle *Handle, int Type, bool On); -- cgit v1.2.3