Merge branch '219_negative_ac3_pcm_delay'
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 4 Nov 2009 15:20:13 +0000 (16:20 +0100)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 4 Nov 2009 15:20:13 +0000 (16:20 +0100)
data/setup.xml
lib/python/Components/FileList.py
lib/python/Components/NimManager.py
lib/python/Components/config.py
lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/service/servicemp3.cpp

index 0d59d8b..9425afd 100644 (file)
                        <item level="0" text="Brightness">config.lcd.bright</item>
                        <item level="0" text="Contrast">config.lcd.contrast</item>
                        <item level="0" text="Standby">config.lcd.standby</item>
-                       <item level="2" text="Invert display">config.lcd.invert</item>
                </setup>
                <setup key="satconfig" title="Sat / Dish Setup">
                        <item text="Tuner Slot">config.sat.tunerslot</item>
index 54bb1ac..38b0854 100755 (executable)
@@ -23,6 +23,7 @@ EXTENSIONS = {
                "ts": "movie",
                "avi": "movie",
                "divx": "movie",
+               "m4v": "movie",
                "mpg": "movie",
                "mpeg": "movie",
                "mkv": "movie",
index 70cde47..5154e2b 100644 (file)
@@ -939,7 +939,7 @@ def InitNimManager(nimmgr):
 
        lnb_choices = {
                "universal_lnb": _("Universal LNB"),
-               "unicable": _("Unicable"),
+#              "unicable": _("Unicable"),
                "c_band": _("C-Band"),
                "user_defined": _("User defined")}
 
index 789ec32..d17f771 100755 (executable)
@@ -1184,7 +1184,10 @@ class ConfigSatlist(ConfigSelection):
        def __init__(self, list, default = None):
                if default is not None:
                        default = str(default)
-               ConfigSelection.__init__(self, choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list], default = default)
+               choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list]
+               choices.sort(key = lambda x: int(x[0]))
+               
+               ConfigSelection.__init__(self, choices = choices, default = default)
 
        def getOrbitalPosition(self):
                if self.value == "":
index feb39a9..53287a3 100755 (executable)
@@ -82,7 +82,9 @@ class DVDToolbox(Screen):
                self.update()
 
        def mediainfoCB(self, mediuminfo, retval, extra_args):
-               capacity = 1
+               formatted_capacity = 0
+               read_capacity = 0
+               capacity = 0
                used = 0
                infotext = ""
                mediatype = ""
@@ -93,21 +95,17 @@ class DVDToolbox(Screen):
                                        self.formattable = True
                                else:
                                        self.formattable = False
-                       if line.find("Legacy lead-out at:") > -1:
+                       elif line.find("Legacy lead-out at:") > -1:
                                used = int(line.rsplit('=',1)[1]) / 1048576.0
-                               print "[lead out] used =", used
+                               print "[dvd+rw-mediainfo] lead out used =", used
                        elif line.find("formatted:") > -1:
-                               capacity = int(line.rsplit('=',1)[1]) / 1048576.0
-                               print "[formatted] capacity =", capacity
-                       elif capacity == 1 and line.find("READ CAPACITY:") > -1:
-                               capacity = int(line.rsplit('=',1)[1]) / 1048576.0
-                               print "[READ CAP] capacity =", capacity
-                       elif line.find("Disc status:") > -1:
-                               if line.find("blank") > -1:
-                                       print "[Disc status] capacity=%d, used=0" % (capacity)
-                                       capacity = used
-                                       used = 0
-                       elif line.find("Free Blocks:") > -1:
+                               formatted_capacity = int(line.rsplit('=',1)[1]) / 1048576.0
+                               print "[dvd+rw-mediainfo] formatted capacity =", formatted_capacity
+                       elif formatted_capacity == 0 and line.find("READ CAPACITY:") > -1:
+                               read_capacity = int(line.rsplit('=',1)[1]) / 1048576.0
+                               print "[dvd+rw-mediainfo] READ CAPACITY =", read_capacity
+               for line in mediuminfo.splitlines():
+                       if line.find("Free Blocks:") > -1:
                                try:
                                        size = eval(line[14:].replace("KB","*1024"))
                                except:
@@ -116,8 +114,22 @@ class DVDToolbox(Screen):
                                        capacity = size / 1048576
                                        if used:
                                                used = capacity-used
-                                       print "[free blocks] capacity=%d, used=%d" % (capacity, used)
+                                       print "[dvd+rw-mediainfo] free blocks capacity=%d, used=%d" % (capacity, used)
+                       elif line.find("Disc status:") > -1:
+                               if line.find("blank") > -1:
+                                       print "[dvd+rw-mediainfo] Disc status blank capacity=%d, used=0" % (capacity)
+                                       capacity = used
+                                       used = 0
+                               elif line.find("complete") > -1 and formatted_capacity == 0:
+                                       print "[dvd+rw-mediainfo] Disc status complete capacity=0, used=%d" % (capacity)
+                                       used = read_capacity
+                                       capacity = 1
+                               else:
+                                       capacity = formatted_capacity
                        infotext += line+'\n'
+               if capacity and used > capacity:
+                       used = read_capacity or capacity
+                       capacity = formatted_capacity or capacity
                self["details"].setText(infotext)
                if self.formattable:
                        self["key_yellow"].text = _("Format")
index 596f2d5..98bc060 100644 (file)
@@ -110,7 +110,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
 
                # 'None' is magic to start at the list of mountpoints
                defaultDir = config.mediaplayer.defaultDir.getValue()
-               self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+               self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
                self["filelist"] = self.filelist
 
                self.playlist = MyPlayList()
index 7f87ffa..34d0936 100644 (file)
@@ -34,6 +34,7 @@ eServiceFactoryMP3::eServiceFactoryMP3()
                extensions.push_back("vob");
                extensions.push_back("wav");
                extensions.push_back("wave");
+               extensions.push_back("m4v");
                extensions.push_back("mkv");
                extensions.push_back("avi");
                extensions.push_back("divx");
@@ -42,7 +43,6 @@ eServiceFactoryMP3::eServiceFactoryMP3()
                extensions.push_back("mp4");
                extensions.push_back("mov");
                extensions.push_back("m4a");
-               extensions.push_back("m2ts");
                sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
        }
 
@@ -236,7 +236,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
                sourceinfo.containertype = ctAVI;
                sourceinfo.is_video = TRUE;
        }
-       else if ( strcasecmp(ext, ".mp4") == 0 || strcasecmp(ext, ".mov") == 0)
+       else if ( strcasecmp(ext, ".mp4") == 0 || strcasecmp(ext, ".mov") == 0 || strcasecmp(ext, ".m4v") == 0)
        {
                sourceinfo.containertype = ctMP4;
                sourceinfo.is_video = TRUE;