summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-12-01 18:51:45 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-12-08 11:15:38 (GMT)
commit66b765734585971dd9d248059701fdecebbccd78 (patch)
treee724ea0ff4806a19efc26f6089d2026e9c32fe47 /src/3rdparty
parentbed33ac62d87073120d56ff75a3d2356c99c64ea (diff)
downloadQt-66b765734585971dd9d248059701fdecebbccd78.zip
Qt-66b765734585971dd9d248059701fdecebbccd78.tar.gz
Qt-66b765734585971dd9d248059701fdecebbccd78.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
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp14
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp16
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)