summaryrefslogtreecommitdiffstats
path: root/src/plugins/wmf/player/mfplayersession.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-07-30 14:24:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-16 15:30:10 +0200
commit291f1229feff087ac9a850ec7a92152f1b69af58 (patch)
treebb1da2a25e4dc0328f3c32558acc2c185515a541 /src/plugins/wmf/player/mfplayersession.cpp
parentbdf0cc7a168e88c5692831ada7f209ce3b41a501 (diff)
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>
Diffstat (limited to 'src/plugins/wmf/player/mfplayersession.cpp')
-rw-r--r--src/plugins/wmf/player/mfplayersession.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index fb150c3e9..4e4b56589 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -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();