update for buffer api change
[platform/upstream/gstreamer.git] / tests / examples / app / appsrc-stream.c
index 51398d7..01e9362 100644 (file)
@@ -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));