diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-09-04 14:59:55 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-09-15 09:10:21 +0000 |
commit | e9cf6670fe61f67c8f16ed0393086c07f88582dd (patch) | |
tree | a2ccdfc9f1a5f1bff7fcfee02bc72b11fe8d11b8 /src/plugins/avfoundation/mediaplayer | |
parent | fdac8d9c74185e39a46581be8519501251b88fc8 (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.mm | 5 |
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); } |