mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling Transfer Mode when replaying Dolby Digital audio and the option '-a' was given
This commit is contained in:
parent
c8c22ad49b
commit
a512b9a9fa
@ -309,6 +309,8 @@ Werner Fink <werner@suse.de>
|
|||||||
and firmware can handle live DD without the need of a Transfer Mode
|
and firmware can handle live DD without the need of a Transfer Mode
|
||||||
for fixing cDvbDevice::SetAudioBypass() in case setTransferModeForDolbyDigital is
|
for fixing cDvbDevice::SetAudioBypass() in case setTransferModeForDolbyDigital is
|
||||||
false
|
false
|
||||||
|
for a patch that was used as a base to fix handling Transfer Mode when replaying
|
||||||
|
Dolby Digital audio and the option '-a' was given
|
||||||
|
|
||||||
Rolf Hakenes <hakenes@hippomi.de>
|
Rolf Hakenes <hakenes@hippomi.de>
|
||||||
for providing 'libdtv' and adapting the EIT mechanisms to it
|
for providing 'libdtv' and adapting the EIT mechanisms to it
|
||||||
|
6
HISTORY
6
HISTORY
@ -4716,8 +4716,12 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed automatically updating the CAM menu in case the whole operation (for
|
- Fixed automatically updating the CAM menu in case the whole operation (for
|
||||||
instance a firmware update) takes longer than the menu timeout.
|
instance a firmware update) takes longer than the menu timeout.
|
||||||
|
|
||||||
2006-05-19: Version 1.4.0-2
|
2006-05-20: Version 1.4.0-2
|
||||||
|
|
||||||
- Removed leftover LSMOD=... line from 'runvdr'.
|
- Removed leftover LSMOD=... line from 'runvdr'.
|
||||||
- Modified the Makefile to copy additional libraries a plugin might provide (suggested
|
- Modified the Makefile to copy additional libraries a plugin might provide (suggested
|
||||||
by Wayne Keer). See PLUGINS.html for details.
|
by Wayne Keer). See PLUGINS.html for details.
|
||||||
|
- Fixed handling Transfer Mode when replaying Dolby Digital audio and the option
|
||||||
|
'-a' was given (based on a patch from Werner Fink). To avoid having to increment
|
||||||
|
the API version, several #if checks have been introduced around this. These will
|
||||||
|
be removed once the API version actually needs to be incremented.
|
||||||
|
19
audio.c
19
audio.c
@ -4,11 +4,18 @@
|
|||||||
* 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: audio.c 1.3 2005/02/12 12:40:51 kls Exp $
|
* $Id: audio.c 1.4 2006/05/20 10:02:08 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "stdlib.h"
|
#include <stdlib.h>
|
||||||
|
// TODO remove the following if APIVERSNUM > 10400
|
||||||
|
#include "config.h"
|
||||||
|
#if APIVERSNUM != 10400
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
#endif
|
||||||
|
// TODO
|
||||||
|
#include "dvbdevice.h"
|
||||||
|
|
||||||
// --- cAudio ----------------------------------------------------------------
|
// --- cAudio ----------------------------------------------------------------
|
||||||
|
|
||||||
@ -61,6 +68,14 @@ void cExternalAudio::Play(const uchar *Data, int Length, uchar Id)
|
|||||||
if (command && !mute) {
|
if (command && !mute) {
|
||||||
if (pipe || pipe.Open(command, "w")) {
|
if (pipe || pipe.Open(command, "w")) {
|
||||||
if (0x80 <= Id && Id <= 0x87 || Id == 0xBD) { // AC3
|
if (0x80 <= Id && Id <= 0x87 || Id == 0xBD) { // AC3
|
||||||
|
#if APIVERSNUM == 10400
|
||||||
|
extern int cDvbDevice__setTransferModeForDolbyDigital;
|
||||||
|
cDvbDevice__setTransferModeForDolbyDigital = 2;
|
||||||
|
cDvbDevice::SetTransferModeForDolbyDigital(false);
|
||||||
|
#else
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
cDvbDevice::SetTransferModeForDolbyDigital(2);
|
||||||
|
#endif
|
||||||
int written = Data[8] + 9; // skips the PES header
|
int written = Data[8] + 9; // skips the PES header
|
||||||
if (Id != 0xBD)
|
if (Id != 0xBD)
|
||||||
written += 4; // skips AC3 bytes
|
written += 4; // skips AC3 bytes
|
||||||
|
26
dvbdevice.c
26
dvbdevice.c
@ -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.156 2006/04/01 14:19:43 kls Exp $
|
* $Id: dvbdevice.c 1.157 2006/05/20 09:52:23 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbdevice.h"
|
#include "dvbdevice.h"
|
||||||
@ -356,7 +356,12 @@ void cDvbTuner::Action(void)
|
|||||||
// --- cDvbDevice ------------------------------------------------------------
|
// --- cDvbDevice ------------------------------------------------------------
|
||||||
|
|
||||||
int cDvbDevice::devVideoOffset = -1;
|
int cDvbDevice::devVideoOffset = -1;
|
||||||
bool cDvbDevice::setTransferModeForDolbyDigital = true;
|
int cDvbDevice::setTransferModeForDolbyDigital = 1;
|
||||||
|
#if APIVERSNUM == 10400
|
||||||
|
int cDvbDevice__setTransferModeForDolbyDigital = -1;
|
||||||
|
#else
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
#endif
|
||||||
|
|
||||||
cDvbDevice::cDvbDevice(int n)
|
cDvbDevice::cDvbDevice(int n)
|
||||||
{
|
{
|
||||||
@ -653,7 +658,7 @@ eVideoSystem cDvbDevice::GetVideoSystem(void)
|
|||||||
|
|
||||||
bool cDvbDevice::SetAudioBypass(bool On)
|
bool cDvbDevice::SetAudioBypass(bool On)
|
||||||
{
|
{
|
||||||
if (!setTransferModeForDolbyDigital)
|
if (setTransferModeForDolbyDigital != 1)
|
||||||
return false;
|
return false;
|
||||||
return ioctl(fd_audio, AUDIO_SET_BYPASS_MODE, On) == 0;
|
return ioctl(fd_audio, AUDIO_SET_BYPASS_MODE, On) == 0;
|
||||||
}
|
}
|
||||||
@ -914,10 +919,23 @@ void cDvbDevice::SetDigitalAudioDevice(bool On)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if APIVERSNUM == 10400
|
||||||
void cDvbDevice::SetTransferModeForDolbyDigital(bool On)
|
void cDvbDevice::SetTransferModeForDolbyDigital(bool On)
|
||||||
{
|
{
|
||||||
|
if (cDvbDevice__setTransferModeForDolbyDigital >= 0) {
|
||||||
|
setTransferModeForDolbyDigital = cDvbDevice__setTransferModeForDolbyDigital;
|
||||||
|
cDvbDevice__setTransferModeForDolbyDigital = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
setTransferModeForDolbyDigital = On;
|
setTransferModeForDolbyDigital = On;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
void cDvbDevice::SetTransferModeForDolbyDigital(int Mode)
|
||||||
|
{
|
||||||
|
setTransferModeForDolbyDigital = Mode;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void cDvbDevice::SetAudioTrackDevice(eTrackType Type)
|
void cDvbDevice::SetAudioTrackDevice(eTrackType Type)
|
||||||
{
|
{
|
||||||
@ -932,7 +950,7 @@ void cDvbDevice::SetAudioTrackDevice(eTrackType Type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IS_DOLBY_TRACK(Type)) {
|
else if (IS_DOLBY_TRACK(Type)) {
|
||||||
if (!setTransferModeForDolbyDigital)
|
if (setTransferModeForDolbyDigital == 0)
|
||||||
return;
|
return;
|
||||||
// Currently this works only in Transfer Mode
|
// Currently this works only in Transfer Mode
|
||||||
ForceTransferMode();
|
ForceTransferMode();
|
||||||
|
14
dvbdevice.h
14
dvbdevice.h
@ -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.39 2006/04/01 14:18:59 kls Exp $
|
* $Id: dvbdevice.h 1.40 2006/05/20 09:32:06 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DVBDEVICE_H
|
#ifndef __DVBDEVICE_H
|
||||||
@ -104,14 +104,24 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool digitalAudio;
|
bool digitalAudio;
|
||||||
static bool setTransferModeForDolbyDigital;
|
static int setTransferModeForDolbyDigital;
|
||||||
protected:
|
protected:
|
||||||
virtual int GetAudioChannelDevice(void);
|
virtual int GetAudioChannelDevice(void);
|
||||||
virtual void SetAudioChannelDevice(int AudioChannel);
|
virtual void SetAudioChannelDevice(int AudioChannel);
|
||||||
virtual void SetVolumeDevice(int Volume);
|
virtual void SetVolumeDevice(int Volume);
|
||||||
virtual void SetDigitalAudioDevice(bool On);
|
virtual void SetDigitalAudioDevice(bool On);
|
||||||
public:
|
public:
|
||||||
|
#if APIVERSNUM == 10400
|
||||||
static void SetTransferModeForDolbyDigital(bool On);
|
static void SetTransferModeForDolbyDigital(bool On);
|
||||||
|
#else
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
static void SetTransferModeForDolbyDigital(int Mode);
|
||||||
|
///< Controls how the DVB device handles Transfer Mode when replaying
|
||||||
|
///< Dolby Digital audio.
|
||||||
|
///< 0 = don't set "audio bypass" in driver/firmware, don't force Transfer Mode
|
||||||
|
///< 1 = set "audio bypass" in driver/firmware, force Transfer Mode (default)
|
||||||
|
///< 2 = don't set "audio bypass" in driver/firmware, force Transfer Mode
|
||||||
|
#endif
|
||||||
|
|
||||||
// Player facilities
|
// Player facilities
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user