4
votes

I'm using Qt Creator 2.7.2 (Qt 5.1) on Windows 8 Pro x64. I'm having trouble with QMediaPlayer. There are some MP3 files on my PC which run fine on Windows Media Player, but QMediaPlayer can't play them. Following statement:

void MainWindow::onPlayerStateChanged(QMediaPlayer::State state)
{
    qDebug() << "onPlayerStateChanged" << state
             << media_player.error() << media_player.errorString();
    // ....
}

is the slot connected to media player's stateChanged signal throws following output:

onPlayerStateChanged QMediaPlayer::PlayingState QMediaPlayer::NoError "" 
DirectShowPlayerService::doRender: Unresolved error code 80040266
onPlayerStateChanged QMediaPlayer::StoppedState QMediaPlayer::ResourceError "" 
DirectShowPlayerService::doRender: Unresolved error code 80040266

Any idea what's wrong?

1
You do mean mp3? As in audio?Bart
@Bart: yes, MP3 as an audio file. Windows Media Player plays it fine.Donotalo
Okay, because doRender made me think we were dealing with video here, where I could imagine licensing playing a role. But that's not it then.Bart
Donotalo, have you solved the problem? I also get the ResourceError with mp3 files. But they start playing after the error was raised. Totally confusingChristian Rapp

1 Answers

2
votes

It might have something to to with the ID3 tags of the file.

I had a similar problem: I was trying to play some MP3 files with QMediaPlayer. One of the files generated that error while the others played fine (on Windows 7). On Linux though, they all played fine.

So I ran the 'file' command on my MP3 files and noticed that the problematic MP3 file had a ID3 version 2.4.0 tag while all the others had ID3 version 2.3.0. I deleted the ID3 tag of that file completely using an ID3 tag editor and after that the file played successfully.

A wild guess here: DirectShow, which is used by QMediaPlayer as backend on Windows, chokes on ID3 version 2.4 and only recognizes older versions. And QMediaPlayer on Linux uses GStreamer as backend, which does not have that problem.