mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
inputselector: Try to not push read-only buffers
We should only increase the refcount before pushing if we're really going to use the buffer afterwards.
This commit is contained in:
parent
ef0e9b6840
commit
a257cb6f5b
1 changed files with 4 additions and 2 deletions
|
@ -1044,7 +1044,10 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
GST_LOG_OBJECT (pad, "Forwarding buffer %p with timestamp %" GST_TIME_FORMAT,
|
||||
buf, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
||||
|
||||
res = gst_pad_push (sel->srcpad, gst_buffer_ref (buf));
|
||||
/* Only make the buffer read-only when necessary */
|
||||
if (sel->sync_streams && sel->cache_buffers)
|
||||
buf = gst_buffer_ref (buf);
|
||||
res = gst_pad_push (sel->srcpad, buf);
|
||||
GST_LOG_OBJECT (pad, "Buffer %p forwarded result=%d", buf, res);
|
||||
|
||||
GST_INPUT_SELECTOR_LOCK (sel);
|
||||
|
@ -1061,7 +1064,6 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
gst_input_selector_cleanup_old_cached_buffers (sel, pad);
|
||||
} else {
|
||||
selpad->pushed = TRUE;
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||
|
||||
|
|
Loading…
Reference in a new issue