]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/blobdiff - src/gstducativc1dec.c
mpeg2dec: Fix negotiation issue with playbin
[glsdk/gst-plugin-ducati.git] / src / gstducativc1dec.c
index 023d20006d02db14aedefb16a72366a71ad9d03b..324e75d8a37493f6576a49c9b60fdf64857ef3d0 100644 (file)
@@ -160,10 +160,8 @@ gst_ducati_vc1dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf)
   GstDucatiVC1Dec *self = GST_DUCATIVC1DEC (vdec);
   IVC1VDEC_Params *params = (IVC1VDEC_Params *) vdec->params;
   guint32 val;
-  gsize bufoffset, bufmaxsize, buftotalsize;
-  gsize bufdatasize;
-  guint8 *bufdata = NULL;
-
+  GstMapInfo info;
+  gboolean mapped;
 
   /* need a base ts for frame layer timestamps */
   if (self->first_ts == GST_CLOCK_TIME_NONE)
@@ -238,11 +236,11 @@ gst_ducati_vc1dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf)
     push_input (vdec, (const guint8 *) &val, 4);
   }
 
-  buftotalsize = gst_buffer_get_sizes (buf, &bufoffset, &bufmaxsize);
-  bufdata = g_slice_alloc (buftotalsize);
-  bufdatasize = gst_buffer_extract (buf, bufoffset, bufdata, buftotalsize);
-  push_input (vdec, bufdata, bufdatasize);
-  g_slice_free1 (buftotalsize, bufdata);
+  mapped = gst_buffer_map (buf, &info, GST_MAP_READ);
+  if (mapped) {
+    push_input (vdec, info.data, info.size);
+    gst_buffer_unmap (buf, &info);
+  }
   gst_buffer_unref (buf);
 
   return NULL;