summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-09-10 02:19:19 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-09-10 02:19:19 (GMT)
commit331af4d007cc57f6bbb5e2afa5574b670eda0f6d (patch)
tree3719f27e7e4b0f75891cda29366c028df64ffb8f /src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
parentd5c4411081a6c6d58ed3ccbd134c423f08b8ece5 (diff)
downloadQt-331af4d007cc57f6bbb5e2afa5574b670eda0f6d.zip
Qt-331af4d007cc57f6bbb5e2afa5574b670eda0f6d.tar.gz
Qt-331af4d007cc57f6bbb5e2afa5574b670eda0f6d.tar.bz2
Invoke on appropriate states in seek().
Diffstat (limited to 'src/3rdparty/phonon/mmf/abstractmediaplayer.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index bdf188d..2f2146b 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -173,15 +173,29 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms)
TRACE_CONTEXT(AbstractMediaPlayer::seek, EAudioApi);
TRACE_ENTRY("state %d pos %Ld", state(), ms);
- // TODO: put a state guard in here
-
- const bool tickTimerWasRunning = m_tickTimer->isActive();
- stopTickTimer();
+ switch (m_state) {
+ // Fallthrough all these
+ case GroundState:
+ case StoppedState:
+ case PausedState:
+ case PlayingState:
+ case LoadingState:
+ {
+ const bool tickTimerWasRunning = m_tickTimer->isActive();
+ stopTickTimer();
- doSeek(ms);
+ doSeek(ms);
- if (tickTimerWasRunning) {
- startTickTimer();
+ if (tickTimerWasRunning) {
+ startTickTimer();
+ }
+ break;
+ }
+ case BufferingState:
+ // Fallthrough
+ case ErrorState:
+ // Do nothing
+ break;
}
TRACE_EXIT_0();