QMediaPlayer Resource Error

I am using Qt Creator 2.7.2 (Qt 5.1) for Windows 8 Pro x64. I have problems with QMediaPlayer. There are some MP3 files on my PC that work fine in Windows Media Player, but QMediaPlayer cannot play them. The following statement:

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

- the slot connected to the stateChanged media player produces the 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 is wrong?

+4
source share
1 answer

It may have something with ID3 file tags.

I had a similar problem: I tried to play some MP3 files with QMediaPlayer. One of the files generated this error, while the others played normally (on Windows 7). However, on Linux everything played fine.

So, I ran the β€œfile” command in my MP3 files and noticed that the problematic MP3 file has ID3 version 2.4.0, and all the others have ID3 version 2.3.0. I completely deleted the ID3 tag of this file using the ID3 tag editor, after which the file was successfully played.

Wild guess here: DirectShow, which is used by QMediaPlayer as a backend on Windows, suffocates from ID3 version 2.4 and only recognizes older versions. And QMediaPlayer on Linux uses GStreamer as a backend, which does not have this problem.

+2
source

Source: https://habr.com/ru/post/1496029/


All Articles