summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2018-07-27 15:34:39 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-08-16 14:02:12 +0000
commitb799d36a9e543bccd921399e929ef7ad17f15497 (patch)
treec2547d36ad2a1fe5ded7adbcd304bc929f598c81 /src
parent02ac3f58721bb52db612acd3bb2e2c26bfc3e05b (diff)
Android: Fix the player state when play() is called with no media
If play() is called before any media is set, don't change the current state to PlayingState. This was inconsistent with the other backends, and required an unneeded call to stop() when a media later got set. Task-number: QTBUG-68998 Change-Id: I8281c7bf83e36e9a80f2136ca9fc2430c55e8bd6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp
index 1c6497eb0..9631a6ba7 100644
--- a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp
+++ b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp
@@ -379,8 +379,6 @@ void QAndroidMediaPlayerControl::play()
setMedia(mMediaContent, mMediaStream);
}
- setState(QMediaPlayer::PlayingState);
-
if ((mState & (AndroidMediaPlayer::Prepared
| AndroidMediaPlayer::Started
| AndroidMediaPlayer::Paused
@@ -389,6 +387,7 @@ void QAndroidMediaPlayerControl::play()
return;
}
+ setState(QMediaPlayer::PlayingState);
mMediaPlayer->play();
}