From: Yoann Lopes Date: Tue, 17 Jun 2014 12:28:20 +0000 (+0200) Subject: GStreamer: fix looping a media when it's loaded from qrc. X-Git-Tag: v5.4.0~11^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7f924186c6cbb98ccf9be7e62ecb1eabb022703;p=platform%2Fupstream%2Fqtmultimedia.git GStreamer: fix looping a media when it's loaded from qrc. When playing a media for the second time, the backend resets the the media by calling setMedia() with the same value. The problem is that setMedia() clears the previous media, which is a QFile in this case and is the one we are trying to set again... The QFile was deleted, causing the current media to be a dangling pointer. Change-Id: I6854b40212fd084d1e31e756a040a02ad103b7ba Reviewed-by: Christian Stromme --- diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index ff99aa3..99c471b 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -371,7 +371,7 @@ void QGstreamerPlayerControl::setMedia(const QMediaContent &content, QIODevice * emit bufferStatusChanged(0); } - if (m_stream) { + if (m_stream && m_stream != stream) { if (m_ownStream) delete m_stream; m_stream = 0;