diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-12-09 12:33:30 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-12-09 12:33:30 +0100 |
commit | 20a8ac86da1f1a75bbc9f8a863de455babccb0c1 (patch) | |
tree | 23f7d375d129e3fa73b739ec85294c50616bf7ea /dxr3audio-oss.c | |
parent | c9459a581236bb1a8329a2f8efadd43f47ee4cce (diff) | |
download | vdr-plugin-dxr3-20a8ac86da1f1a75bbc9f8a863de455babccb0c1.tar.gz vdr-plugin-dxr3-20a8ac86da1f1a75bbc9f8a863de455babccb0c1.tar.bz2 |
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.
Diffstat (limited to 'dxr3audio-oss.c')
-rw-r--r-- | dxr3audio-oss.c | 34 |
1 files changed, 11 insertions, 23 deletions
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; } |