When Mplayer is compiled with I18N, the version number is not on the
first line of output as it is assumed in video/plugins/mplayer.py. This
patch fixes the problem.

Matthieu
-- 
 (~._.~)        Matthieu Weber - Universit� de Jyv�skyl�         (~._.~)
  ( ? )                email : [EMAIL PROTECTED]                  ( ? ) 
 ()- -()               public key id : 452AE0AD                  ()- -()
 (_)-(_)  "Humor ist, wenn man trotzdem lacht (Germain Muller)"  (_)-(_)
Index: video/plugins/mplayer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/video/plugins/mplayer.py,v
retrieving revision 1.56
diff -u -r1.56 mplayer.py
--- video/plugins/mplayer.py    2 Jan 2004 11:17:35 -0000       1.56
+++ video/plugins/mplayer.py    12 Jan 2004 10:04:11 -0000
@@ -85,21 +85,26 @@
         # 0.9 (for 0.9.x series), 1.0 (for 1.0preX series) and 9999 for cvs
         if not hasattr(config, 'MPLAYER_VERSION'):
             child = popen2.Popen3( "%s -v" % config.MPLAYER_CMD, 1, 100)
-            data = child.fromchild.readline() # Just need the first line
-            if data:
-                data = re.search( "^MPlayer (?P<version>\S+)", data )
+            found = 0
+            while not found:
+                data = child.fromchild.readline()
+                if data:
+                    data = re.search( "^MPlayer (?P<version>\S+)", data )
                 if data:                
-                    _debug_("MPlayer version is: %s" % data.group( "version" ))
-                    data = data.group( "version" )
-                    if data[ 0 ] == "1":
-                        config.MPLAYER_VERSION = 1.0
-                    elif data[ 0 ] == "0":
-                        config.MPLAYER_VERSION = 0.9
-                    elif data[ 0 : 7 ] == "dev-CVS":
-                        config.MPLAYER_VERSION = 9999
-                else:
-                    config.MPLAYER_VERSION = None
-                _debug_("MPlayer version set to: %s" % config.MPLAYER_VERSION)
+                    found = 1
+
+            if data:                
+                _debug_("MPlayer version is: %s" % data.group( "version" ))
+                data = data.group( "version" )
+                if data[ 0 ] == "1":
+                    config.MPLAYER_VERSION = 1.0
+                elif data[ 0 ] == "0":
+                    config.MPLAYER_VERSION = 0.9
+                elif data[ 0 : 7 ] == "dev-CVS":
+                    config.MPLAYER_VERSION = 9999
+            else:
+                config.MPLAYER_VERSION = None
+            _debug_("MPlayer version set to: %s" % config.MPLAYER_VERSION)
             child.wait()
 
         if not config.MPLAYER_VERSION:

Reply via email to