gst-docs: add return value to appsink callback in tutorial

The "crude waveform generator" sample application in "Basic
tutorial 8: Short-cutting the pipeline" was lacking the return value
so it was only being invoked once.

https://bugzilla.gnome.org/show_bug.cgi?id=796476
This commit is contained in:
Jacques de Broin 2018-06-01 19:04:48 -04:00 committed by Sebastian Dröge
parent c25c296760
commit 7aea060a60

View file

@ -499,7 +499,7 @@ Once we have the buffer ready, we pass it to `appsrc` with the
``` c ``` c
/* The appsink has received a buffer */ /* The appsink has received a buffer */
static void new_sample (GstElement *sink, CustomData *data) { static GstFlowReturn new_sample (GstElement *sink, CustomData *data) {
GstSample *sample; GstSample *sample;
/* Retrieve the buffer */ /* Retrieve the buffer */
g_signal_emit_by_name (sink, "pull-sample", &sample); g_signal_emit_by_name (sink, "pull-sample", &sample);
@ -507,7 +507,9 @@ static void new_sample (GstElement *sink, CustomData *data) {
/* The only thing we do in this example is print a * to indicate a received buffer */ /* The only thing we do in this example is print a * to indicate a received buffer */
g_print ("*"); g_print ("*");
gst_sample_unref (sample); gst_sample_unref (sample);
return GST_FLOW_OK;
} }
return GST_FLOW_ERROR;
} }
``` ```