diff --git a/ChangeLog b/ChangeLog index 91d38ef8b3..37f820aa1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-01 Johan Dahlin + + * ext/ogg/gstoggdemux.c: + * gst/tags/gstvorbistag.c: + Plug leaks. + 2004-10-31 Benjamin Otte * gst/tags/gstvorbistag.c: (gst_vorbis_tag_chain): diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 1aa0877a85..3bd2cc7f50 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -324,10 +324,15 @@ gst_ogg_demux_finalize (GObject * object) 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_demux_src_event (GstPad * pad, GstEvent * event) 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_ogg_demux_handle_event (GstPad * pad, GstEvent * event) gst_event_unref (event); GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT); FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, - pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;); + pad->flags |= GST_OGG_PAD_NEEDS_DISCONT; + ); break; default: gst_pad_event_default (pad, event); @@ -926,7 +934,8 @@ _find_chain_get_unknown_part (GstOggDemux * ogg, gint64 * start, gint64 * end) *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 @@ _find_streams_check (GstOggDemux * ogg) } 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? */ diff --git a/gst/tags/gstvorbistag.c b/gst/tags/gstvorbistag.c index 7ed8b2b2c7..52c1248831 100644 --- a/gst/tags/gstvorbistag.c +++ b/gst/tags/gstvorbistag.c @@ -565,6 +565,7 @@ gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list, 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 @@ gst_vorbis_tag_chain (GstPad * pad, GstData * data) 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 @@ gst_vorbis_tag_chain (GstPad * pad, GstData * data) 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_vorbis_tag_chain (GstPad * pad, GstData * data) } 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));