summaryrefslogtreecommitdiffstats
path: root/examples/app
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-06-19 11:25:37 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-06-19 11:25:37 +0000
commit1de45598a79c268b70785523b52980562613272c (patch)
treec6e5090efb4fa3c267ba357983898f29eb94290c /examples/app
parent7960b82a401e0444936cbe8ff028ff79b4353ab0 (diff)
downloadgst-plugins-bad-1de45598a79c268b70785523b52980562613272c.tar.gz
gst-plugins-bad-1de45598a79c268b70785523b52980562613272c.tar.bz2
gst-plugins-bad-1de45598a79c268b70785523b52980562613272c.zip
examples/app/appsink-src.c: Don't use a buffer after unreffing it.
Original commit message from CVS: * examples/app/appsink-src.c: (on_new_buffer_from_source): Don't use a buffer after unreffing it.
Diffstat (limited to 'examples/app')
-rw-r--r--examples/app/appsink-src.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/app/appsink-src.c b/examples/app/appsink-src.c
index 6472af30..a92dfb51 100644
--- a/examples/app/appsink-src.c
+++ b/examples/app/appsink-src.c
@@ -38,12 +38,14 @@ on_new_buffer_from_source (GstElement * elt, ProgramData * data)
memcpy (raw_buffer, GST_BUFFER_DATA (buffer), size);
app_buffer = gst_app_buffer_new (raw_buffer, size, g_free, raw_buffer);
- /* we don't need the appsink buffer anymore */
- gst_buffer_unref (buffer);
-
/* newer basesrc will set caps for use automatically but it does not really
* hurt to set it on the buffer again */
gst_buffer_set_caps (app_buffer, GST_BUFFER_CAPS (buffer));
+
+ /* we don't need the appsink buffer anymore */
+ gst_buffer_unref (buffer);
+
+ /* get source an push new buffer */
source = gst_bin_get_by_name (GST_BIN (data->sink), "testsource");
gst_app_src_push_buffer (GST_APP_SRC (source), app_buffer);
}