Commit c074bfd0 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

gst_tag_list_free -> gst_tag_list_unref

parent a549b0bf
......@@ -425,7 +425,7 @@ gst_flac_enc_stop (GstAudioEncoder * enc)
GstFlacEnc *flacenc = GST_FLAC_ENC (enc);
GST_DEBUG_OBJECT (enc, "stop");
gst_tag_list_free (flacenc->tags);
gst_tag_list_unref (flacenc->tags);
flacenc->tags = NULL;
if (FLAC__stream_encoder_get_state (flacenc->encoder) !=
FLAC__STREAM_ENCODER_UNINITIALIZED) {
......@@ -594,7 +594,7 @@ gst_flac_enc_set_metadata (GstFlacEnc * flacenc, guint64 total_samples)
flacenc->meta, entries) != true)
g_warning ("Dude, i'm already initialized!");
gst_tag_list_free (copy);
gst_tag_list_unref (copy);
}
static GstCaps *
......
......@@ -142,7 +142,7 @@ gst_flac_tag_dispose (GObject * object)
tag->vorbiscomment = NULL;
}
if (tag->tags) {
gst_tag_list_free (tag->tags);
gst_tag_list_unref (tag->tags);
tag->tags = NULL;
}
......@@ -377,7 +377,7 @@ gst_flac_tag_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
buffer = gst_tag_list_to_vorbiscomment_buffer (merged_tags, header,
sizeof (header), NULL);
GST_DEBUG_OBJECT (tag, "Writing tags %" GST_PTR_FORMAT, merged_tags);
gst_tag_list_free (merged_tags);
gst_tag_list_unref (merged_tags);
if (buffer == NULL)
goto no_comment;
......@@ -483,7 +483,7 @@ gst_flac_tag_change_state (GstElement * element, GstStateChange transition)
tag->vorbiscomment = NULL;
}
if (tag->tags) {
gst_tag_list_free (tag->tags);
gst_tag_list_unref (tag->tags);
tag->tags = NULL;
}
tag->metadata_block_size = 0;
......
......@@ -259,7 +259,7 @@ gst_shout2send_finalize (GstShout2send * shout2send)
g_free (shout2send->mount);
g_free (shout2send->url);
gst_tag_list_free (shout2send->tags);
gst_tag_list_unref (shout2send->tags);
gst_poll_free (shout2send->timer);
......@@ -348,7 +348,7 @@ gst_shout2send_set_metadata (GstShout2send * shout2send)
shout_metadata_free (pmetadata);
}
gst_tag_list_free (copy);
gst_tag_list_unref (copy);
}
#endif
......
......@@ -790,7 +790,7 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
"calling gst_element_found_tags with %" GST_PTR_FORMAT, tag_list);
gst_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag (tag_list));
} else {
gst_tag_list_free (tag_list);
gst_tag_list_unref (tag_list);
}
/* Handle HTTP errors. */
......
......@@ -312,7 +312,7 @@ gst_speex_dec_parse_comments (GstSpeexDec * dec, GstBuffer * buf)
gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (dec), list,
GST_TAG_MERGE_REPLACE);
gst_tag_list_free (list);
gst_tag_list_unref (list);
g_free (encoder);
g_free (ver);
......
......@@ -269,7 +269,7 @@ gst_speex_enc_stop (GstAudioEncoder * benc)
enc->state = NULL;
}
speex_bits_destroy (&enc->bits);
gst_tag_list_free (enc->tags);
gst_tag_list_unref (enc->tags);
enc->tags = NULL;
gst_tag_setter_reset_tags (GST_TAG_SETTER (enc));
......@@ -350,7 +350,7 @@ gst_speex_enc_create_metadata_buffer (GstSpeexEnc * enc)
GST_DEBUG_OBJECT (enc, "merged tags = %" GST_PTR_FORMAT, merged_tags);
comments = gst_tag_list_to_vorbiscomment_buffer (merged_tags, NULL,
0, "Encoded with GStreamer Speexenc");
gst_tag_list_free (merged_tags);
gst_tag_list_unref (merged_tags);
GST_BUFFER_OFFSET (comments) = 0;
GST_BUFFER_OFFSET_END (comments) = 0;
......
......@@ -292,7 +292,7 @@ gst_flac_parse_finalize (GObject * object)
GstFlacParse *flacparse = GST_FLAC_PARSE (object);
if (flacparse->tags) {
gst_tag_list_free (flacparse->tags);
gst_tag_list_unref (flacparse->tags);
flacparse->tags = NULL;
}
if (flacparse->toc) {
......@@ -347,7 +347,7 @@ gst_flac_parse_stop (GstBaseParse * parse)
GstFlacParse *flacparse = GST_FLAC_PARSE (parse);
if (flacparse->tags) {
gst_tag_list_free (flacparse->tags);
gst_tag_list_unref (flacparse->tags);
flacparse->tags = NULL;
}
if (flacparse->toc) {
......@@ -970,7 +970,7 @@ gst_flac_parse_handle_vorbiscomment (GstFlacParse * flacparse,
if (flacparse->tags == NULL) {
GST_ERROR_OBJECT (flacparse, "Invalid vorbiscomment block");
} else if (gst_tag_list_is_empty (flacparse->tags)) {
gst_tag_list_free (flacparse->tags);
gst_tag_list_unref (flacparse->tags);
flacparse->tags = NULL;
}
......@@ -1125,7 +1125,7 @@ gst_flac_parse_handle_picture (GstFlacParse * flacparse, GstBuffer * buffer)
map.data + gst_byte_reader_get_pos (&reader), img_len, img_type);
if (gst_tag_list_is_empty (flacparse->tags)) {
gst_tag_list_free (flacparse->tags);
gst_tag_list_unref (flacparse->tags);
flacparse->tags = NULL;
}
......@@ -1422,7 +1422,7 @@ gst_flac_parse_generate_headers (GstFlacParse * flacparse)
vorbiscomment =
gst_tag_list_to_vorbiscomment_buffer (taglist, header,
sizeof (header), NULL);
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
gst_buffer_map (vorbiscomment, &map, GST_MAP_WRITE);
......
......@@ -231,7 +231,7 @@ gst_avi_demux_reset_stream (GstAviDemux * avi, GstAviStream * stream)
gst_object_unref (stream->pad);
}
if (stream->taglist) {
gst_tag_list_free (stream->taglist);
gst_tag_list_unref (stream->taglist);
stream->taglist = NULL;
}
memset (stream, 0, sizeof (GstAviStream));
......@@ -278,7 +278,7 @@ gst_avi_demux_reset (GstAviDemux * avi)
}
if (avi->globaltags)
gst_tag_list_free (avi->globaltags);
gst_tag_list_unref (avi->globaltags);
avi->globaltags = NULL;
avi->got_tags = TRUE; /* we always want to push global tags */
......
......@@ -354,7 +354,7 @@ gst_avi_mux_reset (GstAviMux * avimux)
avimux->codec_data_size = 0;
if (avimux->tags_snap) {
gst_tag_list_free (avimux->tags_snap);
gst_tag_list_unref (avimux->tags_snap);
avimux->tags_snap = NULL;
}
......
......@@ -82,7 +82,7 @@ gst_tag_inject_finalize (GObject * object)
GstTagInject *self = GST_TAG_INJECT (object);
if (self->tags) {
gst_tag_list_free (self->tags);
gst_tag_list_unref (self->tags);
self->tags = NULL;
}
......
......@@ -3240,7 +3240,7 @@ gst_flv_demux_dispose (GObject * object)
}
if (demux->taglist) {
gst_tag_list_free (demux->taglist);
gst_tag_list_unref (demux->taglist);
demux->taglist = NULL;
}
......
......@@ -131,7 +131,7 @@ gst_icydemux_reset (GstICYDemux * icydemux)
gst_icydemux_remove_srcpad (icydemux);
if (icydemux->cached_tags) {
gst_tag_list_free (icydemux->cached_tags);
gst_tag_list_unref (icydemux->cached_tags);
icydemux->cached_tags = NULL;
}
......@@ -287,7 +287,7 @@ gst_icydemux_tag_found (GstICYDemux * icydemux, GstTagList * tags)
} else {
gst_tag_list_insert (icydemux->cached_tags, tags,
GST_TAG_MERGE_REPLACE_ALL);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
}
return TRUE;
......@@ -341,7 +341,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
if (!gst_tag_list_is_empty (tags))
gst_icydemux_tag_found (icydemux, tags);
else
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
}
static gboolean
......
......@@ -1174,7 +1174,7 @@ gst_qt_mux_setup_metadata (GstQTMux * qtmux)
GST_DEBUG_OBJECT (qtmux, "Formatting tags");
gst_qt_mux_add_metadata_tags (qtmux, copy);
gst_qt_mux_add_xmp_tags (qtmux, copy);
gst_tag_list_free (copy);
gst_tag_list_unref (copy);
} else {
GST_DEBUG_OBJECT (qtmux, "No tags received");
}
......
......@@ -1808,7 +1808,7 @@ gst_qtdemux_stream_free (GstQTDemux * qtdemux, QtDemuxStream * stream)
gst_caps_unref (stream->caps);
g_free (stream->segments);
if (stream->pending_tags)
gst_tag_list_free (stream->pending_tags);
gst_tag_list_unref (stream->pending_tags);
g_free (stream->redirect_uri);
/* free stbl sub-atoms */
gst_qtdemux_stbl_free (stream);
......@@ -1851,7 +1851,7 @@ gst_qtdemux_change_state (GstElement * element, GstStateChange transition)
gst_buffer_unref (qtdemux->comp_brands);
qtdemux->comp_brands = NULL;
if (qtdemux->tag_list)
gst_tag_list_free (qtdemux->tag_list);
gst_tag_list_unref (qtdemux->tag_list);
qtdemux->tag_list = NULL;
#if 0
if (qtdemux->element_index)
......@@ -1912,7 +1912,7 @@ qtdemux_handle_xmp_taglist (GstQTDemux * qtdemux, GstTagList * taglist)
if (qtdemux->tag_list) {
/* prioritize native tags using _KEEP mode */
gst_tag_list_insert (qtdemux->tag_list, taglist, GST_TAG_MERGE_KEEP);
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
} else
qtdemux->tag_list = taglist;
}
......@@ -5184,7 +5184,7 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
gst_element_add_pad (GST_ELEMENT_CAST (qtdemux), stream->pad);
if (stream->pending_tags)
gst_tag_list_free (stream->pending_tags);
gst_tag_list_unref (stream->pending_tags);
stream->pending_tags = list;
/* global tags go on each pad anyway */
stream->send_global_tags = TRUE;
......@@ -8455,7 +8455,7 @@ qtdemux_tag_add_id32 (GstQTDemux * demux, const char *tag,
}
if (taglist)
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
gst_buffer_unref (buf);
}
......
......@@ -194,7 +194,7 @@ gst_matroska_demux_finalize (GObject * object)
}
if (demux->common.global_tags) {
gst_tag_list_free (demux->common.global_tags);
gst_tag_list_unref (demux->common.global_tags);
demux->common.global_tags = NULL;
}
......@@ -309,7 +309,7 @@ gst_matroska_track_free (GstMatroskaTrackContext * track)
}
if (track->pending_tags)
gst_tag_list_free (track->pending_tags);
gst_tag_list_unref (track->pending_tags);
if (track->index_table)
g_array_free (track->index_table, TRUE);
......@@ -469,7 +469,7 @@ gst_matroska_demux_reset (GstElement * element)
#endif
if (demux->common.global_tags) {
gst_tag_list_free (demux->common.global_tags);
gst_tag_list_unref (demux->common.global_tags);
}
demux->common.global_tags = gst_tag_list_new_empty ();
gst_tag_list_set_scope (demux->common.global_tags, GST_TAG_SCOPE_GLOBAL);
......
......@@ -151,7 +151,7 @@ gst_matroska_parse_finalize (GObject * object)
}
if (parse->common.global_tags) {
gst_tag_list_free (parse->common.global_tags);
gst_tag_list_unref (parse->common.global_tags);
parse->common.global_tags = NULL;
}
......@@ -256,7 +256,7 @@ gst_matroska_track_free (GstMatroskaTrackContext * track)
}
if (track->pending_tags)
gst_tag_list_free (track->pending_tags);
gst_tag_list_unref (track->pending_tags);
if (track->index_table)
g_array_free (track->index_table, TRUE);
......@@ -370,7 +370,7 @@ gst_matroska_parse_reset (GstElement * element)
#endif
if (parse->common.global_tags) {
gst_tag_list_free (parse->common.global_tags);
gst_tag_list_unref (parse->common.global_tags);
}
parse->common.global_tags = gst_tag_list_new_empty ();
......
......@@ -437,7 +437,7 @@ gst_matroska_read_common_found_global_tag (GstMatroskaReadCommon * common,
if (common->global_tags) {
/* nothing sent yet, add to cache */
gst_tag_list_insert (common->global_tags, taglist, GST_TAG_MERGE_APPEND);
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
} else {
GstEvent *tag_event = gst_event_new_tag (taglist);
gint i;
......@@ -713,7 +713,7 @@ gst_matroska_read_common_parse_attachments (GstMatroskaReadCommon * common,
gst_matroska_read_common_found_global_tag (common, el, taglist);
} else {
GST_DEBUG_OBJECT (common, "No valid attachments found");
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
}
common->attachments_parsed = TRUE;
......@@ -1931,7 +1931,7 @@ gst_matroska_read_common_parse_metadata_id_tag (GstMatroskaReadCommon * common,
} else
gst_tag_list_insert (*p_taglist, taglist, GST_TAG_MERGE_APPEND);
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
g_array_unref (chapter_targets);
g_array_unref (edition_targets);
......@@ -1999,7 +1999,7 @@ gst_matroska_read_common_parse_metadata (GstMatroskaReadCommon * common,
if (G_LIKELY (!gst_tag_list_is_empty (taglist)))
gst_matroska_read_common_found_global_tag (common, el, taglist);
else
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
return ret;
}
......
......@@ -224,7 +224,7 @@ gst_wavparse_reset (GstWavParse * wav)
wav->adapter = NULL;
}
if (wav->tags)
gst_tag_list_free (wav->tags);
gst_tag_list_unref (wav->tags);
wav->tags = NULL;
if (wav->toc)
gst_toc_unref (wav->toc);
......@@ -1727,8 +1727,8 @@ gst_wavparse_stream_headers (GstWavParse * wav)
wav->tags =
gst_tag_list_merge (old, new, GST_TAG_MERGE_REPLACE);
if (old)
gst_tag_list_free (old);
gst_tag_list_free (new);
gst_tag_list_unref (old);
gst_tag_list_unref (new);
}
gst_buffer_unref (buf);
wav->offset += GST_ROUND_UP_2 (data_size);
......
......@@ -328,7 +328,7 @@ test_taglib_apev2mux_with_tags (GstTagList * tags, guint32 mask)
GST_LOG ("Got tags: %" GST_PTR_FORMAT, tags_read);
test_taglib_apev2mux_check_tags (tags_read, mask);
gst_tag_list_free (tags_read);
gst_tag_list_unref (tags_read);
GST_LOG ("Waiting for EOS ...");
msg = gst_bus_poll (bus, GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1);
......@@ -367,7 +367,7 @@ GST_START_TEST (test_apev2mux)
/* internal consistency check */
tags = test_taglib_apev2mux_create_tags (0xFFFFFFFF);
test_taglib_apev2mux_check_tags (tags, 0xFFFFFFFF);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
/* now the real tests */
for (i = 0; i < 50; ++i) {
......@@ -390,7 +390,7 @@ GST_START_TEST (test_apev2mux)
test_taglib_apev2mux_with_tags (tags, mask);
/* free tags */
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
}
}
......
......@@ -186,7 +186,7 @@ GST_START_TEST (test_demux)
fail_unless_equals_string (TEST_METADATA, (char *) tag);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
gst_message_unref (message);
gst_caps_unref (caps);
......
......@@ -124,7 +124,7 @@ run_check_for_file (const gchar * filename, CheckTagsFunc * check_func)
tags = read_tags_from_file (filename, FALSE);
fail_unless (tags != NULL, "Failed to extract tags from '%s'", filename);
check_func (tags, filename);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
/* FIXME: need to fix id3demux for short content in push mode */
#if 0
......@@ -132,7 +132,7 @@ run_check_for_file (const gchar * filename, CheckTagsFunc * check_func)
tags = read_tags_from_file (filename, TRUE);
fail_unless (tags != NULL, "Failed to extract tags from '%s'", filename);
check_func (tags, filename);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
#endif
}
......
......@@ -434,7 +434,7 @@ test_taglib_id3mux_with_tags (GstTagList * tags, guint32 mask)
GST_LOG ("Got tags: %" GST_PTR_FORMAT, tags_read);
test_taglib_id3mux_check_tags (tags_read, mask);
gst_tag_list_free (tags_read);
gst_tag_list_unref (tags_read);
fail_unless (tagbuf != NULL);
test_taglib_id3mux_check_tag_buffer (tagbuf, mask);
......@@ -477,7 +477,7 @@ GST_START_TEST (test_id3v2mux)
/* internal consistency check */
tags = test_taglib_id3mux_create_tags (0xFFFFFFFF);
test_taglib_id3mux_check_tags (tags, 0xFFFFFFFF);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
/* now the real tests */
for (i = 0; i < 50; ++i) {
......@@ -500,7 +500,7 @@ GST_START_TEST (test_id3v2mux)
test_taglib_id3mux_with_tags (tags, mask);
/* free tags */
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
}
}
......
......@@ -768,7 +768,7 @@ extract_tags (const gchar * location, GstTagList ** taglist)
gst_message_parse_tag (msg, &tags);
gst_tag_list_insert (*taglist, tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (tags);
gst_tag_list_unref (tags);
}
gst_message_unref (msg);
}
......@@ -858,7 +858,7 @@ test_average_bitrate_custom (const gchar * elementname,
(guint) gst_util_uint64_scale_round ((guint64) total_bytes,
(guint64) 8 * GST_SECOND, (guint64) total_duration);
fail_unless (bitrate == expected);
gst_tag_list_free (taglist);
gst_tag_list_unref (taglist);
}
/* delete file */
......
This diff is collapsed.
......@@ -55,10 +55,10 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data)
ntl = gst_tag_list_merge (received_tags, tl, GST_TAG_MERGE_PREPEND);
if (ntl) {
GST_LOG ("taglists merged: %" GST_PTR_FORMAT, ntl);
gst_tag_list_free (received_tags);
gst_tag_list_unref (received_tags);
received_tags = ntl;
}
gst_tag_list_free (tl);
gst_tag_list_unref (tl);
}
}
break;
......@@ -115,7 +115,7 @@ test_mux_tags (const gchar * tag_str, const gchar * caps,
sent_tags = gst_tag_list_new_from_string (tag_str);
fail_unless (sent_tags != NULL);
gst_tag_setter_merge_tags (setter, sent_tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (sent_tags);
gst_tag_list_unref (sent_tags);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_main_loop_run (loop);
......@@ -155,7 +155,7 @@ test_demux_tags (const gchar * tag_str, const gchar * demuxer,
GST_DEBUG ("testing tags : %s", tag_str);
if (received_tags) {
gst_tag_list_free (received_tags);
gst_tag_list_unref (received_tags);
received_tags = NULL;
}
......@@ -232,9 +232,9 @@ test_demux_tags (const gchar * tag_str, const gchar * demuxer,
fail_unless (found, "tag item %s is lost", name_sent);
}
gst_tag_list_free (received_tags);
gst_tag_list_unref (received_tags);
received_tags = NULL;
gst_tag_list_free (sent_tags);
gst_tag_list_unref (sent_tags);
gst_element_set_state (pipeline, GST_STATE_NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment