diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-01 18:51:45 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-01-11 13:41:49 (GMT) |
commit | a47a0f6712c16e0e7be49fcb3027fb076993ff57 (patch) | |
tree | b6110ada0355314fa9c4f0065e49843ca57f8cd5 | |
parent | b0da36d29288d8ce2d5417c6054373986ed272fa (diff) | |
download | Qt-a47a0f6712c16e0e7be49fcb3027fb076993ff57.zip Qt-a47a0f6712c16e0e7be49fcb3027fb076993ff57.tar.gz Qt-a47a0f6712c16e0e7be49fcb3027fb076993ff57.tar.bz2 |
Changed call sequence of seeking in Phonon MMF backend, for streaming
Modified the sequence of calls made to the MMF APIs when seeking
during ongoing playback. This fixes a bug found during early testing
of streaming playback, whereby playback would not resume following
the seeking operation. This was due to an interaction between the
pause / seek / play operations, and the buffering callbacks received
from the MMF, which caused the backend to enter an incorrect state.
Task-number: QTBUG-4660
Reviewed-by: Frans Englich
(cherry picked from commit 66b765734585971dd9d248059701fdecebbccd78)
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 14 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 16 |
2 files changed, 11 insertions, 19 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 6e7f458..83c534a 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -179,13 +179,20 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) case PlayingState: case LoadingState: { - const bool positionTimerWasRunning = m_positionTimer->isActive(); - stopPositionTimer(); + bool wasPlaying = false; + if (state() == PlayingState) { + stopPositionTimer(); + doPause(); + wasPlaying = true; + } doSeek(ms); - if (positionTimerWasRunning) + if(wasPlaying && state() != ErrorState) { + doPlay(); startPositionTimer(); + } + break; } case BufferingState: @@ -370,7 +377,6 @@ void MMF::AbstractMediaPlayer::doVolumeChanged() } } - //----------------------------------------------------------------------------- // Protected functions //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 4a70d58..dab7505 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -142,24 +142,10 @@ void MMF::VideoPlayer::doSeek(qint64 ms) { TRACE_CONTEXT(VideoPlayer::doSeek, EVideoApi); - bool wasPlaying = false; - if (state() == PlayingState) { - // The call to SetPositionL does not have any effect if playback is - // ongoing, so we pause before seeking. - doPause(); - wasPlaying = true; - } - TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms * 1000))); - if (KErrNone == err) { - if (wasPlaying) - doPlay(); - } - else { - TRACE("SetPositionL error %d", err); + if(KErrNone != err) setError(tr("Seek failed"), err); - } } int MMF::VideoPlayer::setDeviceVolume(int mmfVolume) |