Android: Don't call release() unless it's necessary.
If the mediaplayer is in either Idle or Uninitialized state, then there is no need to call release again. Change-Id: Idb6f2d9ea7aad7a9036e7e9a534c3bd296324068 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
09e3d8a28e
commit
3c3e2c324b
@@ -289,7 +289,9 @@ void QAndroidMediaPlayerControl::setMedia(const QMediaContent &mediaContent,
|
|||||||
mMediaStream = stream;
|
mMediaStream = stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
mMediaPlayer->release();
|
// Release the mediaplayer if it's not in in Idle or Uninitialized state
|
||||||
|
if ((mState & (JMediaPlayer::Idle | JMediaPlayer::Uninitialized)) == 0)
|
||||||
|
mMediaPlayer->release();
|
||||||
|
|
||||||
if (mediaContent.isNull()) {
|
if (mediaContent.isNull()) {
|
||||||
setMediaStatus(QMediaPlayer::NoMedia);
|
setMediaStatus(QMediaPlayer::NoMedia);
|
||||||
|
|||||||
Reference in New Issue
Block a user