summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/mediaplayer
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-09-04 14:59:55 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-09-15 09:10:21 +0000
commite9cf6670fe61f67c8f16ed0393086c07f88582dd (patch)
treea2ccdfc9f1a5f1bff7fcfee02bc72b11fe8d11b8 /src/plugins/avfoundation/mediaplayer
parentfdac8d9c74185e39a46581be8519501251b88fc8 (diff)
AVFoundation: fix rendering when player reached EndOfMedia.
Once the media player reached the end of the media, it shouldn't be rendering frames anymore. This could happen when seeking after reaching the end. The output layer is now cleared on EndOfMedia to make sure that doesn't happen. Change-Id: I18a21eaff6c63a2bd54d4c2953f89eb1722f66d5 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/avfoundation/mediaplayer')
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
index c27601936..50ec1ffac 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
@@ -767,6 +767,11 @@ void AVFMediaPlayerSession::processEOS()
Q_EMIT positionChanged(position());
m_mediaStatus = QMediaPlayer::EndOfMedia;
+ // At this point, frames should not be rendered anymore.
+ // Clear the output layer to make sure of that.
+ if (m_videoOutput)
+ m_videoOutput->setLayer(0);
+
Q_EMIT stateChanged(m_state = QMediaPlayer::StoppedState);
Q_EMIT mediaStatusChanged(m_mediaStatus);
}