mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-15 04:24:18 +00:00
tests/examples/app/appsrc_ex.c: Some comments.
Original commit message from CVS: * 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.
This commit is contained in:
parent
1b2dc5f3a8
commit
15583abf25
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
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:
|
||||
|
|
|
@ -67,14 +67,20 @@ main (int argc, char *argv[])
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue