Fix a playback bug for mediaplayer windows media foundation backend

Task-number:QTMOBILITY-1606

Reviewed-by:Jonas Rabbe
(cherry picked from commit d5426bf52e19c9c6a52837b423f48024979ea076)

Change-Id: Ie7c1c90a8f5a64e77c435ffc1917d8f9638dfff3
Reviewed-on: http://codereview.qt-project.org/5499
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Ling Hu
2011-08-15 11:17:23 +10:00
committed by Qt by Nokia
parent 9cb61ab778
commit 589b2e3adf
3 changed files with 14 additions and 5 deletions

View File

@@ -72,7 +72,12 @@ MFPlayerControl::~MFPlayerControl()
void MFPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream)
{
stop();
if (m_state != QMediaPlayer::StoppedState) {
changeState(QMediaPlayer::StoppedState);
m_session->stop(true);
refreshState();
}
m_media = media;
m_stream = stream;
resetAudioVideoAvailable();