diff -r 4b24a328c655 -r 81e9da9ad7db gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Thu Nov 30 21:05:13 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Fri Dec 01 14:52:05 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", "") +