diff -r ef3b08cbf4b2 -r ef159b06efc1 gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Fri Dec 01 14:30:28 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Fri Dec 01 15:53:55 2006 +0000 @@ -1089,17 +1089,14 @@ guint8 *data = NULL; data = (guint8 *) gst_adapter_take (nuv->priv->adapter, size); *buffer = gst_buffer_new (); - GST_BUFFER_SIZE (buffer) = size; - GST_BUFFER_MALLOCDATA (buffer) = g_malloc (size); - GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer); - g_free (data); + gst_buffer_set_data (*buffer, data, size); + GST_BUFFER_MALLOCDATA (*buffer) = data; + GST_BUFFER_DATA (*buffer) = data; } else { guint8 *data = NULL; data = (guint8 *) gst_adapter_peek (nuv->priv->adapter, size); *buffer = gst_buffer_new (); - GST_BUFFER_SIZE (buffer) = size; - GST_BUFFER_MALLOCDATA (buffer) = g_malloc (size); - GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer); + gst_buffer_set_data (*buffer, data, size); } } return ret;