From: Wim Taymans Date: Thu, 6 Sep 2012 11:35:33 +0000 (+0200) Subject: streamsync: only remove DISCONT when needed X-Git-Tag: 1.19.3~511^2~5955 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b26f35c3a4fe27a3a27a40ecb9ff2c358859c1b7;p=platform%2Fupstream%2Fgstreamer.git streamsync: only remove DISCONT when needed Check if the buffer is DISCONT before making a potentially expensive copy to unset the DISCONT flag. --- diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 7510f15f..d28d540 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -506,8 +506,11 @@ gst_stream_synchronizer_sink_chain (GstPad * pad, GstObject * parent, if (stream) { stream->seen_data = TRUE; if (stream->drop_discont) { - buffer = gst_buffer_make_writable (buffer); - GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT); + if (GST_BUFFER_IS_DISCONT (buffer)) { + GST_DEBUG_OBJECT (pad, "removing DISCONT from buffer %p", buffer); + buffer = gst_buffer_make_writable (buffer); + GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT); + } stream->drop_discont = FALSE; }