summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-09-29 13:26:58 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-09-29 13:26:58 (GMT)
commitd34bbd852241fcd9ddf50c961b5e234f9de0b5ac (patch)
tree8a73901e5029c05d682c5d0813d8e08e2d7290cf /src/3rdparty/phonon
parent2245698c5cf69704d35478950aac61856a568e33 (diff)
downloadQt-d34bbd852241fcd9ddf50c961b5e234f9de0b5ac.zip
Qt-d34bbd852241fcd9ddf50c961b5e234f9de0b5ac.tar.gz
Qt-d34bbd852241fcd9ddf50c961b5e234f9de0b5ac.tar.bz2
Fixed seek during video playback
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r--src/3rdparty/phonon/mmf/TODO.txt3
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp14
2 files changed, 13 insertions, 4 deletions
diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt
index ba15897..a2b1865 100644
--- a/src/3rdparty/phonon/mmf/TODO.txt
+++ b/src/3rdparty/phonon/mmf/TODO.txt
@@ -3,9 +3,6 @@ TODO list for MMF Phonon backend
The following items are in rough order of priority.
-* Seeking does not work for video playback
-Do we need to pause/stop the CVideoPlayerUtility before calling SetPositionL? This is inconsistent with CMdaAudioPlayerUtility, but may be necessary - needs to be tested on target.
-
* Activating full-screen video playback in qmediaplayer causes the app to crash
This may be symptomatic of more general problems with re-sizing / re-positioning video while playing.
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index 8a38b76..64e6568 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -147,10 +147,22 @@ void MMF::VideoPlayer::doStop()
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(KErrNone == err) {
+ if(wasPlaying)
+ doPlay();
+ }
+ else {
TRACE("SetPositionL error %d", err);
setError(NormalError);
}