diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-09-06 13:35:33 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-09-06 13:37:11 +0200 |
commit | b26f35c3a4fe27a3a27a40ecb9ff2c358859c1b7 (patch) | |
tree | 85cd5761d4752b01139b3e0f8d770a6f6ef3f4a3 /gst | |
parent | 20806e4c16d45602778d744d363b341711d9c2da (diff) | |
download | gstreamer-plugins-base-b26f35c3a4fe27a3a27a40ecb9ff2c358859c1b7.tar.gz |
streamsync: only remove DISCONT when needed
Check if the buffer is DISCONT before making a potentially expensive copy to
unset the DISCONT flag.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/playback/gststreamsynchronizer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 7510f15f6..d28d540f6 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; } |