X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fexamples%2Fapp%2Fappsrc-stream.c;h=01e9362f6e0d6d084c5a9cfffc41d078cc70c5ab;hb=345dc31f205befe34c47ea2266c7ef5150943e47;hp=51398d7e12e447d90f618026a0001021a813047a;hpb=9289476e779ba9a0a3f7cbf231171e7a85867632;p=platform%2Fupstream%2Fgstreamer.git diff --git a/tests/examples/app/appsrc-stream.c b/tests/examples/app/appsrc-stream.c index 51398d7..01e9362 100644 --- a/tests/examples/app/appsrc-stream.c +++ b/tests/examples/app/appsrc-stream.c @@ -83,8 +83,6 @@ read_data (App * app) guint len; GstFlowReturn ret; - buffer = gst_buffer_new (); - if (app->offset >= app->length) { /* we are EOS, send end-of-stream and remove the source */ g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret); @@ -92,11 +90,13 @@ read_data (App * app) } /* read the next chunk */ + buffer = gst_buffer_new (); + len = CHUNK_SIZE; if (app->offset + len > app->length) len = app->length - app->offset; - gst_buffer_take_memory (buffer, -1, + gst_buffer_append_memory (buffer, gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY, app->data, app->length, app->offset, len, NULL, NULL));