Random crashes while playing videos through Phonon on Windows
I'm having trouble with some simple video playback code. Let's say I have 3 video files. I want to play them in a loop, every video for 10 seconds. Videos shorter than 10 seconds should be played multiple times. This is the meat of my code:
MainWindow::MainWindow(QWidget *parent) :
connect(timer, SIGNAL(timeout()), this, SLOT(advance()));
connect(videoPlayer, SIGNAL(finished()), this, SLOT(playbackFinished()));
void MainWindow::showEvent(QShowEvent *event)
videoPlayer->setGeometry(10, 10, width()-20, height()-20);
pos = (pos + 1) % playlist.size();
A complete project can be found at "Bitbucket":http://bitbucket.org/haikoschol/phonontest
Screenshots of the crash and resulting debugger session:
edit: In order to get mov and mp4 files to play I installed the K-lite codec pack. Just remembered that and tried running the app with only avi and wmv files. So far it has not crashed, so the problem might be due to the other codecs.
Apologies for replying to myself. After deinstalling the 3rd party codecs and testing for a while it crashed again, but only once, where before it would crash much more often. This seems to happen when I try to play an MPEG-4 H.264 file.
BTW, I don't understand why the file doesn't play without any 3rd party codec on Windows 7. Windows Media Player plays it just fine. Shouldn't everything that works in WMP also work in Phonon::VideoPlayer?
This is a huge problem for the app I'm writing. The customers expect to be able to play common video files, especially if they work in the default media player. WMV can not be used either, since that doesn't work with the Mac version (see "WMV Playback using Phonon::VideoWidget and Flip4Mac fails in 32-Bit builds":http://developer.qt.nokia.com/forums/viewthread/628).
Any help would be greatly appreciated...