summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();