From 8d6a064f7a6f3b38ddf2940290b0ebdc6b4d5356 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 13 Mar 2008 19:15:07 +0000 Subject: add config option to enable/disable ac3 downmix (when its possible with used hardware) --- lib/python/Components/AVSwitch.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py index 044ea43c..65c979d8 100644 --- a/lib/python/Components/AVSwitch.py +++ b/lib/python/Components/AVSwitch.py @@ -151,3 +151,14 @@ def InitAVSwitch(): iAVSwitch.setInput("ENCODER") # init on startup SystemInfo["ScartSwitch"] = eAVSwitch.getInstance().haveScartSwitch() + try: + can_downmix = open("/proc/stb/audio/ac3_choices", "r").read()[:-1].find("downmix") != -1 + except: + can_downmix = False + + SystemInfo["CanDownmixAC3"] = can_downmix + if can_downmix: + def setAC3Downmix(configElement): + open("/proc/stb/audio/ac3", "w").write(configElement.value and "downmix" or "passthrough") + config.av.downmix_ac3 = ConfigYesNo(default = False) + config.av.downmix_ac3.addNotifier(setAC3Downmix) -- cgit v1.2.3