Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Commit

Permalink
Fix for newer versins of mplayer2 that squelch -input cmdlist when ru…
Browse files Browse the repository at this point in the history
…n with

-msglevel all=0.  Now runs without the -msglevel argument and works around
the version string at the end of mplayer2's output.
  • Loading branch information
tonycpsu committed Nov 14, 2013
1 parent 32878df commit 3f11505
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mplayer/core.py
Expand Up @@ -272,9 +272,12 @@ def {name}(self, {sig}):
def _generate_methods(cls):
# Commands which have truncated names in -input cmdlist
truncated = {'osd_show_property_te': 'osd_show_property_text'}
proc = subprocess.Popen([cls.exec_path, '-msglevel', 'all=0', '-input', 'cmdlist'],
proc = subprocess.Popen([cls.exec_path, '-input', 'cmdlist'],
bufsize=-1, stdout=subprocess.PIPE)
for line in proc.stdout:
# skip version string at end of mplayer2 output
if line.startswith("MPlayer"):
continue
args = line.decode('utf-8', 'ignore').split()
if not args:
continue
Expand Down

1 comment on commit 3f11505

@dru0pa
Copy link

@dru0pa dru0pa commented on 3f11505 Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running into this now after switching to newer version of Rasbian (2016-09-23-raspbian-jessie)
File "/usr/local/lib/python3.4/dist-packages/mplayer/core.py", line 278, in _generate_methods
if line.startswith( 'MPlayer' ):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Please sign in to comment.