Fix several misuse of gst_buffer_merge (it doesn't take ownership of any buffer), should fix some leaks. I hope I did...

Original commit message from CVS:
2004-03-06  Christophe Fergeau  <teuf@gnome.org>

* ext/faac/gstfaac.c: (gst_faac_chain):
* ext/flac/gstflactag.c: (gst_flac_tag_chain):
* ext/libpng/gstpngenc.c: (user_write_data):
* ext/mikmod/gstmikmod.c: (gst_mikmod_loop):
* gst/ac3parse/gstac3parse.c: (gst_ac3parse_chain):
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_chain_subtitle):
* gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice):
Fix several misuse of gst_buffer_merge (it doesn't take ownership
of any buffer), should fix some leaks. I hope I didn't unref buffers
that shouldn't be...
This commit is contained in:
Christophe Fergeau 2004-03-06 20:56:28 +00:00
parent 2bc3f35dfc
commit f19f84b5c2
3 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,16 @@
2004-03-06 Christophe Fergeau <teuf@gnome.org>
* ext/faac/gstfaac.c: (gst_faac_chain):
* ext/flac/gstflactag.c: (gst_flac_tag_chain):
* ext/libpng/gstpngenc.c: (user_write_data):
* ext/mikmod/gstmikmod.c: (gst_mikmod_loop):
* gst/ac3parse/gstac3parse.c: (gst_ac3parse_chain):
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_chain_subtitle):
* gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice):
Fix several misuse of gst_buffer_merge (it doesn't take ownership
of any buffer), should fix some leaks. I hope I didn't unref buffers
that shouldn't be...
2004-03-06 Thomas Vander Stichele <thomas at apestaart dot org>
* gst-libs/gst/media-info/media-info-priv.c: (have_type_callback),

View file

@ -227,10 +227,11 @@ gst_ac3parse_chain (GstPad *pad, GstData *_data)
/* deal with partial frame from previous buffer */
if (ac3parse->partialbuf) {
ac3parse->partialbuf = gst_buffer_merge(ac3parse->partialbuf, buf);
/* and the one we received.. */
GstBuffer *merge;
merge = gst_buffer_merge(ac3parse->partialbuf, buf);
gst_buffer_unref(buf);
gst_buffer_unref(ac3parse->partialbuf);
ac3parse->partialbuf = merge;
}
else {
ac3parse->partialbuf = buf;

View file

@ -208,12 +208,14 @@ gst_rfc2250_enc_add_slice (GstRFC2250Enc *enc, GstBuffer *buffer)
while (slice_length > 0) {
GstBuffer *outbuf;
GstBuffer *newbuf;
outbuf = gst_buffer_create_sub (buffer, offset, MIN (enc->remaining, slice_length));
gst_buffer_merge (enc->packet, outbuf);
newbuf = gst_buffer_merge (enc->packet, outbuf);
slice_length -= GST_BUFFER_SIZE (outbuf);
offset += GST_BUFFER_SIZE (outbuf);
gst_buffer_unref (outbuf);
gst_buffer_unref (newbuf);
enc->packet = newbuf;
gst_rfc2250_enc_new_buffer (enc);
}
gst_buffer_unref (buffer);