+2009-01-06 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * tests/examples/app/appsrc_ex.c: (main):
+ Some comments.
+ When pulling a buffer we can get NULL when the element is EOS, don't try
+ to unref this NULL buffer.
+
2009-01-06 Jan Schmidt <jan.schmidt@sun.com>
* gst-libs/gst/video/Makefile.am:
gst_app_src_push_buffer (GST_APP_SRC (app->src), buf);
}
+ /* push EOS */
gst_app_src_end_of_stream (GST_APP_SRC (app->src));
+ /* _is_eos() does not block and returns TRUE if there is not currently an EOS
+ * to be retrieved */
while (!gst_app_sink_is_eos (GST_APP_SINK (app->sink))) {
GstBuffer *buf;
+ /* pull the next item, this can return NULL when there is no more data and
+ * EOS has been received */
buf = gst_app_sink_pull_buffer (GST_APP_SINK (app->sink));
printf ("retrieved buffer %p\n", buf);
- gst_buffer_unref (buf);
+ if (buf)
+ gst_buffer_unref (buf);
}
gst_element_set_state (app->pipe, GST_STATE_NULL);