# HG changeset patch # User renatofilho # Date 1164983428 0 # Node ID ef3b08cbf4b2d215f5750183015c673b24472314 # Parent 27e0944605f21f5e2486579acc6e3f857ab248e8 [svn r164] diff -r 27e0944605f2 -r ef3b08cbf4b2 gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Thu Nov 30 22:27:03 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Fri Dec 01 14:30:28 2006 +0000 @@ -469,9 +469,11 @@ res = GST_FLOW_ERROR; } } + if (file_header != NULL) { gst_buffer_unref (file_header); } + return res; } @@ -732,7 +734,7 @@ timestamp = h->i_timecode * GST_MSECOND; - GST_BUFFER_SIZE (buf) = h->i_length; + //GST_BUFFER_SIZE (buf) = h->i_length; GST_BUFFER_TIMESTAMP (buf) = timestamp; } else { @@ -796,15 +798,18 @@ default: break; } - if (buf != NULL) + if (buf != NULL) { gst_buffer_unref (buf); + buf = NULL; + } goto done; } default: - if (buf != NULL) + if (buf != NULL) { gst_buffer_unref (buf); - + buf = NULL; + } break; } @@ -835,6 +840,9 @@ //GST_WARNING_OBJECT (nuv, "error: %d pushing on srcpad %s", ret, gst_pad_get_name (pad)); } + } else if (buf != NULL) { + gst_buffer_unref (buf); + buf = NULL; } done: @@ -1081,12 +1089,17 @@ guint8 *data = NULL; data = (guint8 *) gst_adapter_take (nuv->priv->adapter, size); *buffer = gst_buffer_new (); - gst_buffer_set_data (*buffer, data, size); + GST_BUFFER_SIZE (buffer) = size; + GST_BUFFER_MALLOCDATA (buffer) = g_malloc (size); + GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer); + g_free (data); } else { guint8 *data = NULL; data = (guint8 *) gst_adapter_peek (nuv->priv->adapter, size); *buffer = gst_buffer_new (); - gst_buffer_set_data (*buffer, data, size); + GST_BUFFER_SIZE (buffer) = size; + GST_BUFFER_MALLOCDATA (buffer) = g_malloc (size); + GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer); } } return ret; @@ -1208,6 +1221,7 @@ } case GST_EVENT_EOS: + g_debug ("EEEEEEEEEEEEEEEEEOOOOOOOOOOOOOOOOOOOOOOSSSSSSSSSS"); default: res = gst_pad_event_default (pad, event); break; @@ -1403,4 +1417,5 @@ GST_VERSION_MINOR, "nuvdemux", "Demuxes and muxes audio and video", - plugin_init, VERSION, "LGPL", "NuvDemux", "") + plugin_init, VERSION, "LGPL", "NuvDemux", "") +