[0.11] gst-plugins-good: update for memory api change

Wim Taymans wtay at kemper.freedesktop.org
Mon Feb 13 09:13:33 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: e3b5a2e40d65369d91172c7aa789461cc1a32dcd
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=e3b5a2e40d65369d91172c7aa789461cc1a32dcd

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Mon Feb 13 17:13:17 2012 +0100

update for memory api change

---

 gst/multifile/gstmultifilesink.c |    4 ++--
 gst/udp/gstmultiudpsink.c        |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gst/multifile/gstmultifilesink.c b/gst/multifile/gstmultifilesink.c
index 5694440..2ce4ad0 100644
--- a/gst/multifile/gstmultifilesink.c
+++ b/gst/multifile/gstmultifilesink.c
@@ -692,8 +692,8 @@ buffer_list_copy_data (GstBuffer ** buf, guint idx, gpointer data)
   for (i = 0; i < num; ++i) {
     GstMemory *mem;
 
-    mem = gst_buffer_peek_memory (*buf, i, GST_MAP_READ);
-    gst_buffer_take_memory (dest, -1, gst_memory_ref (mem));
+    mem = gst_buffer_get_memory (*buf, i);
+    gst_buffer_take_memory (dest, -1, mem);
   }
 
   return TRUE;
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
index a13b360..9766a84 100644
--- a/gst/udp/gstmultiudpsink.c
+++ b/gst/udp/gstmultiudpsink.c
@@ -458,7 +458,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
 
   size = 0;
   for (i = 0; i < n_mem; i++) {
-    mem = gst_buffer_peek_memory (buffer, i, GST_MAP_READ);
+    mem = gst_buffer_get_memory (buffer, i);
     gst_memory_map (mem, &map[i], GST_MAP_READ);
 
     if (map[i].size > UDP_MAX_SIZE) {
@@ -510,8 +510,10 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
   g_mutex_unlock (&sink->client_lock);
 
   /* unmap all memory again */
-  for (i = 0; i < n_mem; i++)
+  for (i = 0; i < n_mem; i++) {
     gst_memory_unmap (map[i].memory, &map[i]);
+    gst_memory_unref (map[i].memory);
+  }
 
   g_free (vec);
   g_free (map);



More information about the gstreamer-commits mailing list