mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
manual: Fix buffer memory leak in appsrc example
g_signal_emit_by_name() is not like gst_app_src_push_buffer() due to reference counting limitations of signals, it does *not* take ownership of the buffer.
This commit is contained in:
parent
8daad351a4
commit
a4db38ab05
1 changed files with 2 additions and 1 deletions
|
@ -742,6 +742,7 @@ cb_need_data (GstElement *appsrc,
|
|||
timestamp += GST_BUFFER_DURATION (buffer);
|
||||
|
||||
g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
if (ret != GST_FLOW_OK) {
|
||||
/* something wrong, stop pushing */
|
||||
|
|
Loading…
Reference in a new issue