Reputation: 9696
I'm having an issue with the Phonon VideoPlayer I can't find an answer to.
I've boiled it down to the following, trivial example:
from PyQt4.phonon import Phonon
from PyQt4 import QtGui
import PyQt4.QtCore
import sys
class TestPlayer(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
widget = QtGui.QWidget()
layout = QtGui.QVBoxLayout()
widget.setLayout(layout)
self.setCentralWidget(widget)
self.player = Phonon.VideoPlayer(widget)
layout.addWidget(self.player)
start = QtGui.QPushButton('Start')
start.clicked.connect(self.select_and_play)
layout.addWidget(start)
self.mediaSource = None
def select_and_play(self):
f = QtGui.QFileDialog.getOpenFileName(None, 'File :-)')
print 'playing: %s' % f
self.mediaSource = Phonon.MediaSource(f)
self.player.play(self.mediaSource)
if __name__ == '__main__':
print 'pyqt: %s' % PyQt4.QtCore.PYQT_VERSION_STR
print 'py version: %s' % sys.version
app = QtGui.QApplication([])
tester = TestPlayer()
tester.show()
app.exec_()
Executing this gives:
pyqt: 4.11
py version: 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
playing: C:/Users/Public/Videos/Sample Videos/Wildlife.wmv
The next thing happening is that windows informs me that "python has stopped working" with no further, useable error information. Note that the media file is some windows sample video, which of course plays just fine in any other videoplayer. This is on windows 7 professional, SP1 using the latest binary installer for PyQt4 from the riverbank website.
I've tried upgrading PyQt4 and successfully ran the PyQt phonon examples. I don't really know where to start looking for the issue from this point on...
Upvotes: 3
Views: 302
Reputation: 9696
Gotcha!
So I tried debugging this with Visual Studio Express, using the pdb files from python.org.
This did not directly help, but Visual Studio revealed that the seg fault appeared in nvumdshim.dll
, which belongs to my nvidia graphics drivers.
I updated those - and things are working just fine now.
Upvotes: 2