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);
}
/* 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));