Commit 291f1229 authored by Yoann Lopes's avatar Yoann Lopes Committed by The Qt Project
Browse files

WMF: fixed QMediaPlayer changing to EndOfMedia status too early.


It was changing to EndOfMedia status and explicitly stopping playback
when receiving the MEEndOfPresentation event from the WMF session.
However, this event means that all data has bean read from the source but
not necessarily played yet. According to the documentation, playback is
done when the MESessionEnded event is sent. It now reports the EndOfMedia
status at that moment instead. stop() is not explicitly called anymore since
MESessionEnded also implies the session has stopped.

Task-number: QTBUG-30825
Change-Id: I6c6c09e736fe33f7cf17c75038ea7be1b5701a1c
Reviewed-by: default avatarChristian Stromme <christian.stromme@digia.com>
No related merge requests found
Showing with 7 additions and 7 deletions
......@@ -1918,19 +1918,17 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
changeStatus(QMediaPlayer::BufferedMedia);
emit bufferStatusChanged(bufferStatus());
break;
case MEEndOfPresentation:
stop();
changeStatus(QMediaPlayer::EndOfMedia);
m_varStart.vt = VT_I8;
//keep reporting the final position after end of media
m_varStart.hVal.QuadPart = m_duration;
break;
case MESessionEnded:
m_pendingState = NoPending;
m_state.command = CmdStop;
m_state.prevCmd = CmdNone;
m_request.command = CmdNone;
m_request.prevCmd = CmdNone;
changeStatus(QMediaPlayer::EndOfMedia);
m_varStart.vt = VT_I8;
//keep reporting the final position after end of media
m_varStart.hVal.QuadPart = m_duration;
break;
case MEEndOfPresentationSegment:
break;
......@@ -1993,6 +1991,8 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
}
}
break;
default:
break;
}
sessionEvent->Release();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment