Author: tack
Date: Tue Dec 12 02:34:38 2006
New Revision: 2225

Modified:
   trunk/popcorn/src/backends/manager.py
   trunk/popcorn/src/backends/xine/child.py
   trunk/popcorn/src/backends/xine/player.py
   trunk/popcorn/src/generic.py
   trunk/popcorn/src/utils/mrl.py

Log:
parse_mrl supports DVD directories; add has_capability and get_capabilities
methods back to generic player; fix a couple other small bugs.


Modified: trunk/popcorn/src/backends/manager.py
==============================================================================
--- trunk/popcorn/src/backends/manager.py       (original)
+++ trunk/popcorn/src/backends/manager.py       Tue Dec 12 02:34:38 2006
@@ -174,8 +174,8 @@
         if not choice or choice[1] < rating:
             choice = player, rating
 
-        if not choice:
-            return None
+    if not choice:
+        return None
 
     return choice[0]["class"]
 

Modified: trunk/popcorn/src/backends/xine/child.py
==============================================================================
--- trunk/popcorn/src/backends/xine/child.py    (original)
+++ trunk/popcorn/src/backends/xine/child.py    Tue Dec 12 02:34:38 2006
@@ -417,10 +417,10 @@
         if notify != None:
             if notify:
                 print "DEINTERLACE CHEAP MODE: True"
-                self._deint_post.set_parameters(cheap_mode = True)
+                self._deint_post.set_parameters(cheap_mode = True, 
framerate_mode = 'half_top')
             else:
                 print "DEINTERLACE CHEAP MODE: False"
-                self._deint_post.set_parameters(cheap_mode = False)
+                self._deint_post.set_parameters(cheap_mode = False, 
framerate_mode = 'full')
 
             self._driver_control("set_notify_frame", notify)
         if size != None:

Modified: trunk/popcorn/src/backends/xine/player.py
==============================================================================
--- trunk/popcorn/src/backends/xine/player.py   (original)
+++ trunk/popcorn/src/backends/xine/player.py   Tue Dec 12 02:34:38 2006
@@ -104,9 +104,10 @@
 
     def _child_set_status(self, pos, time, length, status, speed):
         old_pos = self._position
-        if self.get_state() in (STATE_PAUSED, STATE_PLAYING, STATE_OPEN):
+        if self.get_state() in (STATE_PAUSED, STATE_PLAYING, STATE_OPEN) and 
time is not None:
             self._position = float(time)
-        self._streaminfo["length"] = length
+        if length is not None:
+            self._streaminfo["length"] = length
 
         if status == 2:
             if self.get_state() not in (STATE_PAUSED, STATE_PLAYING):

Modified: trunk/popcorn/src/generic.py
==============================================================================
--- trunk/popcorn/src/generic.py        (original)
+++ trunk/popcorn/src/generic.py        Tue Dec 12 02:34:38 2006
@@ -630,3 +630,20 @@
         """
         if self._player:
             return self._player.unlock_frame_buffer()
+
+    def get_capabilities(self):
+        """
+        Return player capabilities.
+        """
+        if not self._player:
+            return ()
+        return self._player.get_capabilities()
+
+
+    def has_capability(self, cap):
+        """
+        Return if the player has the given capability.
+        """
+        if not self._player:
+            return False
+        return self._player.has_capability(cap)

Modified: trunk/popcorn/src/utils/mrl.py
==============================================================================
--- trunk/popcorn/src/utils/mrl.py      (original)
+++ trunk/popcorn/src/utils/mrl.py      Tue Dec 12 02:34:38 2006
@@ -37,7 +37,8 @@
     follows the mrl scheme.  If no mrl scheme is specified in 'mrl', it
     attempts to make an intelligent choice.
     """
-    scheme, path = re.search("^(\w{,4}:)?(.*)", mrl).groups()
+    scheme, path = re.search("^(?:(\w{,4}):(?://)?)?(.*)", mrl).groups()
+
     if not scheme:
         scheme = "file"
         try:
@@ -45,8 +46,12 @@
         except OSError:
             return scheme, path
 
-        if stat_info[stat.ST_MODE] & stat.S_IFIFO:
+        if stat_info.st_mode & stat.S_IFIFO:
             scheme = "fifo"
+        elif stat_info.st_mode & stat.S_IFDIR:
+            if os.path.isdir(os.path.join(path, 'VIDEO_TS')):
+                scheme = 'dvd'
+                path = os.path.realpath(path)
         else:
             try:
                 f = open(path)
@@ -58,6 +63,4 @@
                 b = f.read(550000)
                 if b.find('OSTA UDF Compliant') != -1 or b.find("VIDEO_TS") != 
-1:
                     scheme = "dvd"
-    else:
-        scheme = scheme[:-1]
     return scheme, path

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to