From: <jd...@fr...> - 2004-11-01 10:38:49
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: jdahlin Date: Mon Nov 01 2004 02:38:42 PST Log message: Plug more leaks. Modified files: . : ChangeLog ext/ogg : gstoggdemux.c gst/tags : gstvorbistag.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1242&r2=1.1243 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/ogg/gstoggdemux.c.diff?r1=1.54&r2=1.55 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/tags/gstvorbistag.c.diff?r1=1.21&r2=1.22 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1242 retrieving revision 1.1243 diff -u -d -r1.1242 -r1.1243 --- ChangeLog 31 Oct 2004 17:29:01 -0000 1.1242 +++ ChangeLog 1 Nov 2004 10:38:29 -0000 1.1243 @@ -1,3 +1,9 @@ +2004-11-01 Johan Dahlin <jo...@gn...> + + * ext/ogg/gstoggdemux.c: + * gst/tags/gstvorbistag.c: + Plug leaks. 2004-10-31 Benjamin Otte <ot...@gn...> * gst/tags/gstvorbistag.c: (gst_vorbis_tag_chain): Index: gstoggdemux.c RCS file: /cvs/gstreamer/gst-plugins/ext/ogg/gstoggdemux.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- gstoggdemux.c 31 Oct 2004 17:16:58 -0000 1.54 +++ gstoggdemux.c 1 Nov 2004 10:38:30 -0000 1.55 @@ -324,10 +324,15 @@ ogg = GST_OGG_DEMUX (object); + ogg_sync_destroy (&ogg->sync); /* chains are removed when going to READY */ g_assert (ogg->current_chain == -1); g_assert (ogg->chains->len == 0); g_array_free (ogg->chains, TRUE); + if (G_OBJECT_CLASS (parent_class)->finalize) + G_OBJECT_CLASS (parent_class)->finalize (object); } static const GstFormat * @@ -562,10 +567,12 @@ GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK); FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, - pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;); + pad->flags |= GST_OGG_PAD_NEEDS_DISCONT; + ); if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) { FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, - pad->flags |= GST_OGG_PAD_NEEDS_FLUSH;); + pad->flags |= GST_OGG_PAD_NEEDS_FLUSH; + ); } GST_DEBUG_OBJECT (ogg, "initiating seeking to format %d, offset %" G_GUINT64_FORMAT, format, @@ -640,7 +647,8 @@ gst_event_unref (event); GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT); break; default: gst_pad_event_default (pad, event); @@ -926,7 +934,8 @@ *end = G_MAXINT64; g_assert (ogg->current_chain >= 0); - FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset);); + FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset); + ); if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) { *end = gst_file_pad_get_length (ogg->sinkpad); @@ -1055,7 +1064,8 @@ } else { endpos = G_MAXINT64; FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1, - endpos = MIN (endpos, pad->start_offset);); + endpos = MIN (endpos, pad->start_offset); + ); } if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) { /* have we found the endposition for all streams yet? */ Index: gstvorbistag.c RCS file: /cvs/gstreamer/gst-plugins/gst/tags/gstvorbistag.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- gstvorbistag.c 31 Oct 2004 17:29:02 -0000 1.21 +++ gstvorbistag.c 1 Nov 2004 10:38:30 -0000 1.22 @@ -565,6 +565,7 @@ memcpy (data, cur, size); data += size; + g_list_foreach (my_data.entries, (GFunc) g_free, NULL); g_list_free (my_data.entries); *data = 1; @@ -580,22 +581,28 @@ tag = GST_VORBIS_TAG (gst_pad_get_parent (pad)); if (tag->output == OUTPUT_UNKNOWN) { + GstCaps *vorbis_caps = gst_caps_new_simple ("audio/x-vorbis", NULL); + GstCaps *tags_caps = gst_caps_new_simple ("application/x-gst-tags", NULL); /* caps nego */ do { - if (gst_pad_try_set_caps (tag->srcpad, - gst_caps_new_simple ("audio/x-vorbis", NULL)) >= 0) { + if (gst_pad_try_set_caps (tag->srcpad, vorbis_caps) >= 0) { tag->output = OUTPUT_DATA; - } else if (gst_pad_try_set_caps (tag->srcpad, - gst_caps_new_simple ("application/x-gst-tags", NULL)) >= 0) { + } else if (gst_pad_try_set_caps (tag->srcpad, tags_caps) >= 0) { tag->output = OUTPUT_TAGS; } else { const GstCaps *caps = gst_static_caps_get (&gst_vorbis_tag_src_template.static_caps); if (gst_pad_recover_caps_error (tag->srcpad, caps)) continue; + gst_caps_free (vorbis_caps); + gst_caps_free (tags_caps); return; } while (FALSE); + gst_caps_free (vorbis_caps); + gst_caps_free (tags_caps); if (GST_BUFFER_SIZE (buffer) == 0) @@ -607,6 +614,7 @@ GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buffer, "\003vorbis", 7, &vendor); + const GstTagList *found_tags; gst_data_unref (data); if (list == NULL) { @@ -616,8 +624,10 @@ } gst_element_found_tags_for_pad (GST_ELEMENT (tag), tag->srcpad, 0, gst_tag_list_copy (list)); - gst_tag_list_insert (list, gst_tag_setter_get_list (GST_TAG_SETTER (tag)), - gst_tag_setter_get_merge_mode (GST_TAG_SETTER (tag))); + found_tags = gst_tag_setter_get_list (GST_TAG_SETTER (tag)); + if (found_tags) + gst_tag_list_insert (list, found_tags, + gst_tag_setter_get_merge_mode (GST_TAG_SETTER (tag))); data = GST_DATA (gst_tag_list_to_vorbiscomment_buffer (list, "\003vorbis", 7, vendor)); |