mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
basesink: copy last_sample on DRAIN
Make sure we don't hold a ref to a buffer from before the DRAIN query by making a copy of the last_buffer.
This commit is contained in:
parent
ee348fe7cb
commit
093574053f
1 changed files with 10 additions and 0 deletions
|
@ -4827,8 +4827,18 @@ gst_base_sink_default_query (GstBaseSink * basesink, GstQuery * query)
|
|||
break;
|
||||
}
|
||||
case GST_QUERY_DRAIN:
|
||||
{
|
||||
GstBuffer *old;
|
||||
|
||||
GST_OBJECT_LOCK (basesink);
|
||||
if ((old = basesink->priv->last_buffer))
|
||||
basesink->priv->last_buffer = gst_buffer_copy (old);
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
if (old)
|
||||
gst_buffer_unref (old);
|
||||
res = TRUE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
res =
|
||||
gst_pad_query_default (basesink->sinkpad, GST_OBJECT_CAST (basesink),
|
||||
|
|
Loading…
Reference in a new issue