QMediaPlayer pause/seek/play anomaly (Windows 10/Qt 6.2)
-
I've noticed the following sequence of events produces (what seems to me) a surprising result. For example:
- Load and play a video.
- Pause (e.g. after 3s)
- Set position/seek (e.g. back to 1s)
- Play
Perhaps mistakenly, I expected Play would start at 1s. Instead it jumps back to 3s and continues from there.
Though I want it to Play from the seek position, I can't find an obvious way to remedy the situation though I may have missed something obvious in the API spec. So hopefully someone can shed some light.
BTW: internally I noticed within MFPlayerSession, when event 'MESessionPaused' is handled, the member variable m_position caches the clock time (obtained from time source's GetCorrelatedTime()). This makes sense as 'Play' should again start from m_position.
However, I would have thought inserting a seek between Pause and Play would change this behaviour as the intent is to seek and Play from a different position.
Perhaps, when PMFPlayerSession::play() detects 'scrubbing' is turned on, it should update m_position before then calling IMFMediaSession::start()?
-
Hi and welcome to devnet,
The reasoning sounds good to me. I would suggests checking the bug report system to see if there's already something related to that.
-
Yes please, with a all the details and if possible provide a minimal compilable example so that the developers can get started with the same starting point as you.