add config option to enable/disable ac3 downmix (when its possible with used
[enigma2.git] / lib / python / Components / AVSwitch.py
index 044ea43c75cf01575d8f82af97e8c9e6f32e5cb2..65c979d8284f9f5914d6320120405df7456e8e7b 100644 (file)
@@ -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)