baudm / mplayer.py

Lightweight Python wrapper for MPlayer
http://pypi.python.org/pypi/mplayer.py
GNU Lesser General Public License v3.0
117 stars 32 forks source link

MPlayer crashes when using getattr on certain properties #5

Closed baudm closed 9 years ago

baudm commented 9 years ago

Original issue 2 created by baudm on 2011-03-17T10:58:35.000Z:

What steps will reproduce the problem?

---------------snip------------------

import mplayer p = mplayer.Player() for attribute in dir(p): getattr(p, attribute)

---------------snap------------------

What is the expected output? What do you see instead? Either nothing if the value of the property can be retrieved or a message in the form "Failed to get value of property %s" % property. Instead MPlayer crashes with signal "11" in module "unknown"

What version of the product are you using? On what operating system? Machine # 1: Python 2.6.6 on Debian 6.6.0 (squeeze) with PyMPlayer-0.6.0 (installed through pip) and MPlayer SVN-r31918 from debian-multimedia.org repository Machine # 2: Debian unstable with identical Python and PyMPlayer versions, but MPlayer SVN-r33057 from same repository

Please provide any additional information below. I was able to fix the problem by adding a list of properties to be excluded to the "_generate_properties(cls)" method in line 190 and not adding those to the class. The list of properties to exclude that I arrived at through trial&error on my machine is as follows: exclude = ['capturing','sub', 'sub_demux', 'sub_file', 'sub_source',\ 'sub_vob', 'switch_program', 'teletext_page',\ 'tv_brightness', 'tv_contrast', 'tv_hue', 'tv_saturation']

baudm commented 9 years ago

Comment #1 originally posted by baudm on 2011-03-19T06:12:14.000Z:

This is actually an MPlayer bug. Accessing the 'capturing' property works when MPlayer is currently playing a file. I can't just blacklist valid commands and properties because doing so will limit functionality, as far as the Python API is concerned.