summaryrefslogtreecommitdiff
path: root/dxr3audio-oss.c
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2010-04-16 21:23:19 +0200
committerChristian Gmeiner <christian.gmeiner@gmail.com>2010-04-16 21:23:19 +0200
commitb06b679a780f8ab0f636e94abd38f2090829b713 (patch)
treed37301cd46efb6e5594c3b5516daa1f5ea133f47 /dxr3audio-oss.c
parent59e94aed06da78b0dce94d2540c98c97bdc31968 (diff)
downloadvdr-plugin-dxr3-b06b679a780f8ab0f636e94abd38f2090829b713.tar.gz
vdr-plugin-dxr3-b06b679a780f8ab0f636e94abd38f2090829b713.tar.bz2
All audio modes should work with oss driver except ac3 passthrough
It is also possible to change audio related settings in setup menu of the plugin and they become active immediately.
Diffstat (limited to 'dxr3audio-oss.c')
-rw-r--r--dxr3audio-oss.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/dxr3audio-oss.c b/dxr3audio-oss.c
index c13e91d..148c900 100644
--- a/dxr3audio-oss.c
+++ b/dxr3audio-oss.c
@@ -24,6 +24,7 @@
#include "dxr3audio-oss.h"
#include "dxr3device.h"
+#include "settings.h"
static const char *DEV_DXR3_OSS = "_ma";
@@ -91,21 +92,34 @@ void cAudioOss::poll(cPoller &poller)
void cAudioOss::setDigitalAudio(bool on)
{
- if (digitalAudio == on) {
+ if (digitalAudio == on)
return;
- }
- uint32_t ioval = 0;
+ reconfigure();
- if (on) {
- ioval = EM8300_AUDIOMODE_DIGITALPCM;
+ digitalAudio = on;
+}
+
+void cAudioOss::reconfigure()
+{
+ uint32_t ioval = 0;
+ dsyslog("[dxr3-oss] reconfigure");
+
+ // this is quite an imporant part, as we need to
+ // decide how we set the audiomode of oss device.
+ if (digitalAudio) {
+ ioval = EM8300_AUDIOMODE_DIGITALAC3;
} else {
- ioval = EM8300_AUDIOMODE_ANALOG;
+
+ // digital or analog pcm?
+ if (cSettings::instance()->useDigitalOut()) {
+ ioval = EM8300_AUDIOMODE_DIGITALPCM;
+ } 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.
cDxr3Device::instance()->ossSetPlayMode(ioval);
-
- digitalAudio = on;
}