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: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
bdf0cc7a16
commit
291f1229fe
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user