From 20a8ac86da1f1a75bbc9f8a863de455babccb0c1 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 9 Dec 2009 12:33:30 +0100 Subject: change structure of iAudio class This change introduces some bigger changes in how analog/digital audio will be handled. VDR notifices the plugin via cDxr3Device::SetDigitalAudioDevice, if if the we need to use analog or digital audio. With digital audio I mean digital PCM. Based on the informations get via the pes packet ac3dts will be switched on or off. So the svdrp commands SDO, SAO and SAC3 do not make sense at the moment. --- dxr3audio-oss.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'dxr3audio-oss.c') diff --git a/dxr3audio-oss.c b/dxr3audio-oss.c index ae6cbea..9f3409d 100644 --- a/dxr3audio-oss.c +++ b/dxr3audio-oss.c @@ -38,14 +38,6 @@ void cAudioOss::openDevice() exit(1); } - if (cDxr3ConfigData::instance()->GetUseDigitalOut()) { - dsyslog("[dxr3-audio-oss] audio mode: digital"); - setAudioMode(DigitalPcm); - } else { - dsyslog("[dxr3-audio-oss] audio mode: analog"); - setAudioMode(Analog); - } - open = true; } @@ -91,27 +83,23 @@ void cAudioOss::write(uchar* data, size_t size) } } -void cAudioOss::setAudioMode(AudioMode mode) +void cAudioOss::setDigitalAudio(bool on) { - uint32_t ioval = 0; + if (digitalAudio == on) { + return; + } - switch (mode) { - case Analog: - ioval = EM8300_AUDIOMODE_ANALOG; - break; + uint32_t ioval = 0; - case DigitalPcm: + if (on) { ioval = EM8300_AUDIOMODE_DIGITALPCM; - break; - - case Ac3: - ioval = EM8300_AUDIOMODE_DIGITALAC3; - break; + } else { + ioval = EM8300_AUDIOMODE_ANALOG; } // we need to do it this way, as we dont have access // to the file handle for the conrtol sub device. - if (cDxr3Interface::instance()->OssSetPlayMode(ioval)) { - this->mode = mode; - } + cDxr3Interface::instance()->OssSetPlayMode(ioval); + + digitalAudio = on; } -- cgit v1.2.3