Patch by Moritz Venn: Allow to set an additional delay via config.
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 11 Mar 2009 07:12:01 +0000 (08:12 +0100)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 11 Mar 2009 07:12:01 +0000 (08:12 +0100)
Note that this requires driver support, which is not necessarily complete.

data/setup.xml
lib/python/Components/AVSwitch.py
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
lib/service/servicedvb.cpp

index e2ab09b..17301f2 100644 (file)
@@ -13,6 +13,8 @@
                        <item level="0" text="TV System">config.av.tvsystem</item>
                        <item level="1" text="WSS on 4:3">config.av.wss</item>
                        <item level="1" text="AC3 default">config.av.defaultac3</item>
                        <item level="0" text="TV System">config.av.tvsystem</item>
                        <item level="1" text="WSS on 4:3">config.av.wss</item>
                        <item level="1" text="AC3 default">config.av.defaultac3</item>
+                       <item level="1" text="General AC3 delay">config.av.generalAC3delay</item>
+                       <item level="1" text="General PCM delay">config.av.generalPCMdelay</item>
                        <item level="1" text="AC3 downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
                        <item level="1" text="Auto scart switching" requires="ScartSwitch">config.av.vcrswitch</item>
                </setup>
                        <item level="1" text="AC3 downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
                        <item level="1" text="Auto scart switching" requires="ScartSwitch">config.av.vcrswitch</item>
                </setup>
index 3188469..8f4255b 100644 (file)
@@ -1,4 +1,5 @@
-from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, ConfigEnableDisable, ConfigSubsection, ConfigBoolean
+from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \
+       ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigNumber
 from enigma import eAVSwitch, getDesktop
 from SystemInfo import SystemInfo
 
 from enigma import eAVSwitch, getDesktop
 from SystemInfo import SystemInfo
 
@@ -110,6 +111,8 @@ def InitAVSwitch():
        config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
        config.av.wss = ConfigEnableDisable(default = True)
        config.av.defaultac3 = ConfigYesNo(default = False)
        config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
        config.av.wss = ConfigEnableDisable(default = True)
        config.av.defaultac3 = ConfigYesNo(default = False)
+       config.av.generalAC3delay = ConfigNumber(default = 0)
+       config.av.generalPCMdelay = ConfigNumber(default = 0)
        config.av.vcrswitch = ConfigEnableDisable(default = False)
 
        iAVSwitch = AVSwitch()
        config.av.vcrswitch = ConfigEnableDisable(default = False)
 
        iAVSwitch = AVSwitch()
index 5a7dfd1..6b6d504 100644 (file)
@@ -98,6 +98,10 @@ class VideoSetup(Screen, ConfigListScreen):
                        self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
                        if SystemInfo["CanDownmixAC3"]:
                                self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3))
                        self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
                        if SystemInfo["CanDownmixAC3"]:
                                self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3))
+                       self.list.extend((
+                               getConfigListEntry(_("General AC3 Delay"), config.av.generalAC3delay),
+                               getConfigListEntry(_("General PCM Delay"), config.av.generalPCMdelay)
+                       ))
 
                if SystemInfo["CanChangeOsdAlpha"]:
                        self.list.append(getConfigListEntry(_("OSD visibility"), config.av.osd_alpha))
 
                if SystemInfo["CanChangeOsdAlpha"]:
                        self.list.append(getConfigListEntry(_("OSD visibility"), config.av.osd_alpha))
index 12b75f8..012493f 100644 (file)
@@ -2267,8 +2267,18 @@ void eDVBServicePlay::updateDecoder()
                                }
                        }
                }
                                }
                        }
                }
-               m_decoder->setAC3Delay(ac3_delay == -1 ? 0 : ac3_delay);
-               m_decoder->setPCMDelay(pcm_delay == -1 ? 0 : pcm_delay);
+
+               std::string config_delay;
+               int config_delay_int = 0;
+               if(ePythonConfigQuery::getConfigValue("config.av.generalAC3delay", config_delay) == 0)
+                       config_delay_int = atoi(config_delay.c_str());
+               m_decoder->setAC3Delay(ac3_delay == -1 ? config_delay_int : ac3_delay + config_delay_int);
+
+               if(ePythonConfigQuery::getConfigValue("config.av.generalPCMdelay", config_delay) == 0)
+                       config_delay_int = atoi(config_delay.c_str());
+               else
+                       config_delay_int = 0;
+               m_decoder->setPCMDelay(pcm_delay == -1 ? config_delay_int : pcm_delay + config_delay_int);
 
                m_decoder->setVideoPID(vpid, vpidtype);
                selectAudioStream();
 
                m_decoder->setVideoPID(vpid, vpidtype);
                selectAudioStream();