QMediaPlayer::setMedia first call faster than following calls
-
Hi all,
I'm using Qt 5.15 on an arm7 system. My code is implemented in C++ 17.
I have a simple class containing a member of QMediaPlayer. The instance of my class and thus also the QMediaPlayer instance lives forever. My class has a method to play a given sound file. In my case, the sound file is a .wav file. The body of the method is quite simple, it just calls:
m_mediaPlayer->setMedia(m_soundFileUrl); m_mediaPlayer->play();I have a simple UI with a button. And in onClicked I call the method to play a sound. For test purposes, it is currently (hard coded) always the same sound. I observed, that the first call of setMedia is significantly faster than following calls:
duration of setMedia: 20.8233 ms c++Sound: 24ms duration of setMedia: 37.016 ms c++Sound: 39ms duration of setMedia: 37.4577 ms c++Sound: 41ms duration of setMedia: 35.025 ms c++Sound: 38msMy question now is, what is the reason for that?
Regards,
smart_ptr