mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
gst-rtsp-server: Fix leak in appsrc2 example
In the need-data appsrc callback, a buffer is pulled from the appsink. This buffer is then copied so that metadata is writable. The copy is pushed to the appsrc but it doesn't take ownership of the buffer so we need to manually unref it. The original buffer is finally unreffed when the sample is freed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1548>
This commit is contained in:
parent
64085c20b4
commit
49eba42e08
1 changed files with 1 additions and 0 deletions
|
@ -63,6 +63,7 @@ need_data (GstElement * appsrc, guint unused, MyContext * ctx)
|
|||
GST_BUFFER_PTS (buffer) = pts;
|
||||
GST_BUFFER_DTS (buffer) = dts;
|
||||
g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
|
||||
gst_buffer_unref (buffer);
|
||||
}
|
||||
|
||||
/* we don't need the appsink sample anymore */
|
||||
|
|
Loading…
Reference in a new issue