Author: duncan
Date: Fri Sep 29 06:46:12 2006
New Revision: 8251
Modified:
branches/rel-1-5/freevo/src/video/plugins/mplayer.py
Log:
[ 1566373 ] Remove the MPLAYER_VERSION stuff
Fix applied.
Modified: branches/rel-1-5/freevo/src/video/plugins/mplayer.py
==============================================================================
--- branches/rel-1-5/freevo/src/video/plugins/mplayer.py (original)
+++ branches/rel-1-5/freevo/src/video/plugins/mplayer.py Fri Sep 29
06:46:12 2006
@@ -83,66 +83,25 @@
VIDEO_MPLAYER_SUFFIX. This is the default video player for Freevo.
"""
def __init__(self):
- mplayer_version = 0
-
- # Detect version of mplayer. Possible values are
- # 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 = True
- while data:
- data = child.fromchild.readline()
- if data:
- res = re.search( "^MPlayer (?P<version>\S+)", data )
- if res:
- data = res
- break
-
- 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:
- print
- print 'Failed to detect mplayer version. Please set
MPLAYER_VERSION in your'
- print 'local_conf.py to 0.9 (for 0.9.x series), 1.0 (for 1.0preX
series)'
- print 'or 9999 for cvs.'
- print
- self.reason = 'failed to detect mplayer version'
- return
# create plugin structure
plugin.Plugin.__init__(self)
# register mplayer as the object to play video
- plugin.register(MPlayer(config.MPLAYER_VERSION), plugin.VIDEO_PLAYER,
True)
-
-
-
+ plugin.register(MPlayer(plugin.VIDEO_PLAYER, True)
class MPlayer:
"""
the main class to control mplayer
"""
- def __init__(self, version):
+ def __init__(self):
"""
init the mplayer object
"""
self.name = 'mplayer'
self.app_mode = 'video'
- self.version = version
self.seek = 0
self.seek_timer = threading.Timer(0, self.reset_seek)
self.app = None
@@ -261,11 +220,8 @@
if item['deinterlace']:
if config.MPLAYER_VF_INTERLACED:
- if self.version >= 1:
- additional_args += [ '-vf', config.MPLAYER_VF_INTERLACED ]
- else:
- additional_args += [ '-vop', config.MPLAYER_VF_INTERLACED ]
- elif self.version >= 1 and config.MPLAYER_VF_PROGRESSIVE:
+ additional_args += [ '-vf', config.MPLAYER_VF_INTERLACED ]
+ elif config.MPLAYER_VF_PROGRESSIVE:
additional_args += [ '-vf', config.MPLAYER_VF_PROGRESSIVE ]
mode = item.mimetype
@@ -273,8 +229,7 @@
mode = 'default'
# Mplayer command and standard arguments
- command += [ '-v', '-vo', config.MPLAYER_VO_DEV +
- config.MPLAYER_VO_DEV_OPTS ]
+ command += [ '-v', '-vo', config.MPLAYER_VO_DEV +
config.MPLAYER_VO_DEV_OPTS ]
# mode specific args
command += config.MPLAYER_ARGS[mode].split(' ')
@@ -506,9 +461,7 @@
ret += [ arg ]
if vop:
- if self.version >= 1:
- return ret + [ '-vf', vop[1:] ]
- return ret + [ '-vop', vop[1:] ]
+ return ret + [ '-vf', vop[1:] ]
return ret
-------------------------------------------------------------------------
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