Infinite playback of the same file was just one example, the file may change during playback; however, even using the playlist function of QMediaPlayer the problem remains.
Following code does not remove the problem:
while(1)
{
QMediaPlayer *m_player=new QMediaPlayer;
m_player->setMedia(QUrl::fromLocalFile(path_of_file));
m_player->play();
m_player->stop();
sleep(2);
m_player->delete();
}
What do you mean by "de-init" player?
I think the QMediaPlayer :: setMedia method allocates resources when it reads the file through the "backend" but does not deallocate it correctly when changing the file or destroying the player.