From e1bdda4b97983368caa608857fb9030d72e4c8a3 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 14 Jul 2014 15:24:58 +0530 Subject: write-chunks: Use gst_buffer_map instead of gst_memory_map Short-cut. Pointed out in a review by slomo. --- src/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 8067b52..000c6ba 100644 --- a/src/main.c +++ b/src/main.c @@ -122,7 +122,6 @@ write_client_chunk_cb (GstElement *appsink, GstMapInfo info; GstSample *sample; GstBuffer *buffer; - GstMemory *memory; gboolean eos; if (!g_mutex_trylock (&ctx->can_write_chunk)) { @@ -148,14 +147,12 @@ write_client_chunk_cb (GstElement *appsink, } buffer = gst_sample_get_buffer (sample); - memory = gst_buffer_get_all_memory (buffer); /* copy */ - gst_memory_map (memory, &info, GST_MAP_READ); + gst_buffer_map (buffer, &info, GST_MAP_READ); soup_message_body_append (ctx->msg->response_body, SOUP_MEMORY_COPY, info.data, info.size); /* copy */ - gst_memory_unmap (memory, &info); - gst_memory_unref (memory); + gst_buffer_unmap (buffer, &info); gst_sample_unref (sample); soup_server_unpause_message (server, ctx->msg); -- cgit v0.11.2-2-gd1dd