gst_tag_list_free -> gst_tag_list_unref

This commit is contained in:
Tim-Philipp Müller 2012-08-04 16:31:30 +01:00
parent a7037cd0e3
commit 489b102a43
22 changed files with 51 additions and 51 deletions

View file

@ -424,7 +424,7 @@ gst_celt_enc_create_metadata_buffer (GstCeltEnc * enc)
GST_BUFFER_OFFSET_END (comments) = 0; GST_BUFFER_OFFSET_END (comments) = 0;
if (empty_tags) if (empty_tags)
gst_tag_list_free (empty_tags); gst_tag_list_unref (empty_tags);
return comments; return comments;
} }

View file

@ -497,7 +497,7 @@ gst_kate_enc_set_metadata (GstKateEnc * ke)
if (merged_tags) { if (merged_tags) {
GST_DEBUG_OBJECT (ke, "merged tags = %" GST_PTR_FORMAT, merged_tags); GST_DEBUG_OBJECT (ke, "merged tags = %" GST_PTR_FORMAT, merged_tags);
gst_tag_list_foreach (merged_tags, gst_kate_enc_metadata_set1, ke); gst_tag_list_foreach (merged_tags, gst_kate_enc_metadata_set1, ke);
gst_tag_list_free (merged_tags); gst_tag_list_unref (merged_tags);
} }
} }
@ -1081,7 +1081,7 @@ gst_kate_enc_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_CHANGE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_tag_list_free (ke->tags); gst_tag_list_unref (ke->tags);
ke->tags = NULL; ke->tags = NULL;
break; break;
default: default:

View file

@ -316,14 +316,14 @@ gst_kate_tag_parse_packet (GstKateParse * parse, GstBuffer * buffer)
/* build new tag list */ /* build new tag list */
new_tags = gst_tag_list_merge (user_tags, old_tags, new_tags = gst_tag_list_merge (user_tags, old_tags,
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (kt))); gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (kt)));
gst_tag_list_free (old_tags); gst_tag_list_unref (old_tags);
new_buf = new_buf =
gst_tag_list_to_vorbiscomment_buffer (new_tags, gst_tag_list_to_vorbiscomment_buffer (new_tags,
(const guint8 *) "\201kate\0\0\0\0", 9, encoder); (const guint8 *) "\201kate\0\0\0\0", 9, encoder);
gst_buffer_copy_into (new_buf, buffer, GST_BUFFER_COPY_TIMESTAMPS, 0, -1); gst_buffer_copy_into (new_buf, buffer, GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
gst_tag_list_free (new_tags); gst_tag_list_unref (new_tags);
g_free (encoder); g_free (encoder);
gst_buffer_unref (buffer); gst_buffer_unref (buffer);

View file

@ -129,7 +129,7 @@ gst_kate_util_decode_base_reset (GstKateDecoderBase * decoder)
g_free (decoder->category); g_free (decoder->category);
decoder->category = NULL; decoder->category = NULL;
if (decoder->tags) { if (decoder->tags) {
gst_tag_list_free (decoder->tags); gst_tag_list_unref (decoder->tags);
decoder->tags = NULL; decoder->tags = NULL;
} }
decoder->original_canvas_width = 0; decoder->original_canvas_width = 0;
@ -325,9 +325,9 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
/* TODO: category - where should it go ? */ /* TODO: category - where should it go ? */
decoder->tags = decoder->tags =
gst_tag_list_merge (decoder->tags, tags, GST_TAG_MERGE_REPLACE); gst_tag_list_merge (decoder->tags, tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (tags); gst_tag_list_unref (tags);
if (old) if (old)
gst_tag_list_free (old); gst_tag_list_unref (old);
} }
} }
@ -356,7 +356,7 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
if (list) { if (list) {
decoder->tags = decoder->tags =
gst_tag_list_merge (decoder->tags, list, GST_TAG_MERGE_REPLACE); gst_tag_list_merge (decoder->tags, list, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (list); gst_tag_list_unref (list);
} }
if (!decoder->tags) { if (!decoder->tags) {
@ -375,7 +375,7 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
NULL); NULL);
if (old) if (old)
gst_tag_list_free (old); gst_tag_list_unref (old);
if (decoder->initialized) { if (decoder->initialized) {
gst_element_found_tags_for_pad (element, tagpad, decoder->tags); gst_element_found_tags_for_pad (element, tagpad, decoder->tags);
@ -422,7 +422,7 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
} }
} }
if (gst_tag_list_is_empty (evtags)) if (gst_tag_list_is_empty (evtags))
gst_tag_list_free (evtags); gst_tag_list_unref (evtags);
else else
gst_element_found_tags_for_pad (element, tagpad, evtags); gst_element_found_tags_for_pad (element, tagpad, evtags);
} }

View file

@ -344,7 +344,7 @@ gst_opus_enc_stop (GstAudioEncoder * benc)
opus_multistream_encoder_destroy (enc->state); opus_multistream_encoder_destroy (enc->state);
enc->state = NULL; enc->state = NULL;
} }
gst_tag_list_free (enc->tags); gst_tag_list_unref (enc->tags);
enc->tags = NULL; enc->tags = NULL;
g_slist_foreach (enc->headers, (GFunc) gst_buffer_unref, NULL); g_slist_foreach (enc->headers, (GFunc) gst_buffer_unref, NULL);
g_slist_free (enc->headers); g_slist_free (enc->headers);

View file

@ -88,7 +88,7 @@ gst_opus_enc_create_metadata_buffer (const GstTagList * tags)
GST_BUFFER_OFFSET_END (comments) = 0; GST_BUFFER_OFFSET_END (comments) = 0;
if (empty_tags) if (empty_tags)
gst_tag_list_free (empty_tags); gst_tag_list_unref (empty_tags);
return comments; return comments;
} }

View file

@ -179,7 +179,7 @@ gst_selector_pad_finalize (GObject * object)
pad = GST_SELECTOR_PAD_CAST (object); pad = GST_SELECTOR_PAD_CAST (object);
if (pad->tags) if (pad->tags)
gst_tag_list_free (pad->tags); gst_tag_list_unref (pad->tags);
G_OBJECT_CLASS (selector_pad_parent_class)->finalize (object); G_OBJECT_CLASS (selector_pad_parent_class)->finalize (object);
} }
@ -268,7 +268,7 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
GST_OBJECT_LOCK (selpad); GST_OBJECT_LOCK (selpad);
if (selpad->tags) if (selpad->tags)
gst_tag_list_free (selpad->tags); gst_tag_list_unref (selpad->tags);
gst_event_parse_tag (event, &tags); gst_event_parse_tag (event, &tags);
if (tags) if (tags)
tags = gst_tag_list_copy (tags); tags = gst_tag_list_copy (tags);

View file

@ -171,7 +171,7 @@ gst_aiff_parse_reset (GstAiffParse * aiff)
} }
if (aiff->tags != NULL) { if (aiff->tags != NULL) {
gst_tag_list_free (aiff->tags); gst_tag_list_unref (aiff->tags);
aiff->tags = NULL; aiff->tags = NULL;
} }
} }
@ -931,7 +931,7 @@ gst_aiff_parse_stream_headers (GstAiffParse * aiff)
aiff->tags = tags; aiff->tags = tags;
} else { } else {
gst_tag_list_insert (aiff->tags, tags, GST_TAG_MERGE_APPEND); gst_tag_list_insert (aiff->tags, tags, GST_TAG_MERGE_APPEND);
gst_tag_list_free (tags); gst_tag_list_unref (tags);
} }
break; break;
} }

View file

@ -475,7 +475,7 @@ gst_asf_mux_get_content_description_tags (GstAsfMux * asfmux,
tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (asfmux)); tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (asfmux));
if (tags && !gst_tag_list_is_empty (tags)) { if (tags && !gst_tag_list_is_empty (tags)) {
if (asftags->tags != NULL) { if (asftags->tags != NULL) {
gst_tag_list_free (asftags->tags); gst_tag_list_unref (asftags->tags);
} }
asftags->tags = gst_tag_list_new_empty (); asftags->tags = gst_tag_list_new_empty ();
asftags->cont_desc_size = 0; asftags->cont_desc_size = 0;
@ -1323,7 +1323,7 @@ gst_asf_mux_start_file (GstAsfMux * asfmux)
if (asftags) { if (asftags) {
if (asftags->tags) if (asftags->tags)
gst_tag_list_free (asftags->tags); gst_tag_list_unref (asftags->tags);
g_free (asftags); g_free (asftags);
} }
@ -2017,7 +2017,7 @@ gst_asf_mux_pad_reset (GstAsfPad * pad)
gst_buffer_unref (pad->codec_data); gst_buffer_unref (pad->codec_data);
pad->codec_data = NULL; pad->codec_data = NULL;
if (pad->taglist) if (pad->taglist)
gst_tag_list_free (pad->taglist); gst_tag_list_unref (pad->taglist);
pad->taglist = NULL; pad->taglist = NULL;
pad->first_ts = GST_CLOCK_TIME_NONE; pad->first_ts = GST_CLOCK_TIME_NONE;

View file

@ -1868,10 +1868,10 @@ fail:
} }
static void static void
_gst_tag_list_free_maybe (GstTagList * taglist) _gst_tag_list_unref_maybe (GstTagList * taglist)
{ {
if (taglist) if (taglist)
gst_tag_list_free (taglist); gst_tag_list_unref (taglist);
} }
static GstStateChangeReturn static GstStateChangeReturn
@ -1923,7 +1923,7 @@ gst_camera_bin_change_state (GstElement * element, GstStateChange trans)
camera->image_location_list = NULL; camera->image_location_list = NULL;
g_slist_foreach (camera->image_tags_list, g_slist_foreach (camera->image_tags_list,
(GFunc) _gst_tag_list_free_maybe, NULL); (GFunc) _gst_tag_list_unref_maybe, NULL);
g_slist_free (camera->image_tags_list); g_slist_free (camera->image_tags_list);
camera->image_tags_list = NULL; camera->image_tags_list = NULL;
g_mutex_unlock (&camera->image_capture_mutex); g_mutex_unlock (&camera->image_capture_mutex);

View file

@ -638,7 +638,7 @@ gst_jif_mux_mangle_markers (GstJifMux * self)
} }
if (tags && cleanup_tags) if (tags && cleanup_tags)
gst_tag_list_free (tags); gst_tag_list_unref (tags);
return modified; return modified;
} }

View file

@ -585,7 +585,7 @@ extract_and_queue_tags (GstJpegParse * parse, guint size, guint8 * data,
GstTagList *taglist = parse->priv->tags; GstTagList *taglist = parse->priv->tags;
if (taglist) { if (taglist) {
gst_tag_list_insert (taglist, tags, GST_TAG_MERGE_REPLACE); gst_tag_list_insert (taglist, tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (tags); gst_tag_list_unref (tags);
} else { } else {
parse->priv->tags = tags; parse->priv->tags = tags;
} }
@ -1060,7 +1060,7 @@ gst_jpeg_parse_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_adapter_clear (parse->priv->adapter); gst_adapter_clear (parse->priv->adapter);
if (parse->priv->tags) { if (parse->priv->tags) {
gst_tag_list_free (parse->priv->tags); gst_tag_list_unref (parse->priv->tags);
parse->priv->tags = NULL; parse->priv->tags = NULL;
} }
break; break;

View file

@ -498,7 +498,7 @@ mpegts_base_free_program (MpegTSBaseProgram * program)
g_free (program->streams); g_free (program->streams);
if (program->tags) if (program->tags)
gst_tag_list_free (program->tags); gst_tag_list_unref (program->tags);
g_free (program); g_free (program);
} }

View file

@ -87,7 +87,7 @@ gst_mxf_demux_pad_finalize (GObject * object)
GstMXFDemuxPad *pad = GST_MXF_DEMUX_PAD (object); GstMXFDemuxPad *pad = GST_MXF_DEMUX_PAD (object);
if (pad->tags) { if (pad->tags) {
gst_tag_list_free (pad->tags); gst_tag_list_unref (pad->tags);
pad->tags = NULL; pad->tags = NULL;
} }
@ -171,7 +171,7 @@ gst_mxf_demux_reset_mxf_state (GstMXFDemux * demux)
g_free (t->mapping_data); g_free (t->mapping_data);
if (t->tags) if (t->tags)
gst_tag_list_free (t->tags); gst_tag_list_unref (t->tags);
if (t->caps) if (t->caps)
gst_caps_unref (t->caps); gst_caps_unref (t->caps);
@ -763,7 +763,7 @@ gst_mxf_demux_update_essence_tracks (GstMXFDemux * demux)
etrack->handler = NULL; etrack->handler = NULL;
etrack->handle_func = NULL; etrack->handle_func = NULL;
if (etrack->tags) if (etrack->tags)
gst_tag_list_free (etrack->tags); gst_tag_list_unref (etrack->tags);
etrack->tags = NULL; etrack->tags = NULL;
etrack->handler = mxf_essence_element_handler_find (track); etrack->handler = mxf_essence_element_handler_find (track);
@ -828,7 +828,7 @@ gst_mxf_demux_update_essence_tracks (GstMXFDemux * demux)
g_free (etrack->mapping_data); g_free (etrack->mapping_data);
etrack->mapping_data = NULL; etrack->mapping_data = NULL;
if (etrack->tags) if (etrack->tags)
gst_tag_list_free (etrack->tags); gst_tag_list_unref (etrack->tags);
goto next; goto next;
} else if (!caps) { } else if (!caps) {
GST_WARNING_OBJECT (demux, "Couldn't create updated caps for stream"); GST_WARNING_OBJECT (demux, "Couldn't create updated caps for stream");
@ -849,7 +849,7 @@ gst_mxf_demux_update_essence_tracks (GstMXFDemux * demux)
if (new) { if (new) {
g_free (etrack->mapping_data); g_free (etrack->mapping_data);
if (etrack->tags) if (etrack->tags)
gst_tag_list_free (etrack->tags); gst_tag_list_unref (etrack->tags);
if (etrack->caps) if (etrack->caps)
gst_caps_unref (etrack->caps); gst_caps_unref (etrack->caps);

View file

@ -211,7 +211,7 @@ gst_nsfdec_finalize (GObject * object)
gst_buffer_unref (nsfdec->tune_buffer); gst_buffer_unref (nsfdec->tune_buffer);
if (nsfdec->taglist) if (nsfdec->taglist)
gst_tag_list_free (nsfdec->taglist); gst_tag_list_unref (nsfdec->taglist);
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }

View file

@ -470,7 +470,7 @@ teardown (void)
preview_filename = NULL; preview_filename = NULL;
if (tags_found) if (tags_found)
gst_tag_list_free (tags_found); gst_tag_list_unref (tags_found);
tags_found = NULL; tags_found = NULL;
g_free (video_filename); g_free (video_filename);
@ -511,7 +511,7 @@ validity_bus_cb (GstBus * bus, GstMessage * message, gpointer data)
gst_message_parse_tag (message, &taglist); gst_message_parse_tag (message, &taglist);
if (tags_found) { if (tags_found) {
gst_tag_list_insert (tags_found, taglist, GST_TAG_MERGE_REPLACE); gst_tag_list_insert (tags_found, taglist, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (taglist); gst_tag_list_unref (taglist);
} else { } else {
tags_found = taglist; tags_found = taglist;
} }
@ -1098,7 +1098,7 @@ GST_START_TEST (test_image_capture_with_tags)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
check_file_validity (image_filename, i, taglists[i], 0, 0, NO_AUDIO); check_file_validity (image_filename, i, taglists[i], 0, 0, NO_AUDIO);
gst_tag_list_free (taglists[i]); gst_tag_list_unref (taglists[i]);
remove_file (image_filename, i); remove_file (image_filename, i);
} }
} }
@ -1176,7 +1176,7 @@ GST_START_TEST (test_video_capture_with_tags)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
check_file_validity (video_filename, i, taglists[i], 0, 0, NO_AUDIO); check_file_validity (video_filename, i, taglists[i], 0, 0, NO_AUDIO);
gst_tag_list_free (taglists[i]); gst_tag_list_unref (taglists[i]);
remove_file (video_filename, i); remove_file (video_filename, i);
} }
} }

View file

@ -450,7 +450,7 @@ test_taglib_id3mux_with_tags (GstTagList * tags, guint32 mask, int v2version)
GST_LOG ("Got tags: %" GST_PTR_FORMAT, tags_read); GST_LOG ("Got tags: %" GST_PTR_FORMAT, tags_read);
test_taglib_id3mux_check_tags (tags_read, mask, v2version); test_taglib_id3mux_check_tags (tags_read, mask, v2version);
gst_tag_list_free (tags_read); gst_tag_list_unref (tags_read);
fail_unless (tagbuf != NULL); fail_unless (tagbuf != NULL);
test_taglib_id3mux_check_tag_buffer (tagbuf, mask, v2version); test_taglib_id3mux_check_tag_buffer (tagbuf, mask, v2version);
@ -494,7 +494,7 @@ run_id3mux_test (int v2version)
/* internal consistency check */ /* internal consistency check */
tags = test_taglib_id3mux_create_tags (0xFFFFFFFF); tags = test_taglib_id3mux_create_tags (0xFFFFFFFF);
test_taglib_id3mux_check_tags (tags, 0xFFFFFFFF, v2version); test_taglib_id3mux_check_tags (tags, 0xFFFFFFFF, v2version);
gst_tag_list_free (tags); gst_tag_list_unref (tags);
/* now the real tests */ /* now the real tests */
for (i = 0; i < 50; ++i) { for (i = 0; i < 50; ++i) {
@ -517,7 +517,7 @@ run_id3mux_test (int v2version)
test_taglib_id3mux_with_tags (tags, mask, v2version); test_taglib_id3mux_with_tags (tags, mask, v2version);
/* free tags */ /* free tags */
gst_tag_list_free (tags); gst_tag_list_unref (tags);
} }
} }

View file

@ -976,7 +976,7 @@ generate_jif_file_with_tags (const gchar * tags, const gchar * filepath)
taglist = gst_tag_list_new_from_string (tags); taglist = gst_tag_list_new_from_string (tags);
generate_jif_file_with_tags_from_taglist (taglist, filepath); generate_jif_file_with_tags_from_taglist (taglist, filepath);
gst_tag_list_free (taglist); gst_tag_list_unref (taglist);
} }
static void static void
@ -1010,7 +1010,7 @@ libexif_check_tags (const gchar * tags, const gchar * filepath)
libexif_check_tags_from_taglist (taglist, filepath); libexif_check_tags_from_taglist (taglist, filepath);
gst_tag_list_free (taglist); gst_tag_list_unref (taglist);
} }
GST_START_TEST (test_jifmux_tags) GST_START_TEST (test_jifmux_tags)
@ -1069,7 +1069,7 @@ GST_START_TEST (test_jifmux_tags)
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
generate_jif_file_with_tags_from_taglist (taglist, tmpfile); generate_jif_file_with_tags_from_taglist (taglist, tmpfile);
libexif_check_tags_from_taglist (taglist, tmpfile); libexif_check_tags_from_taglist (taglist, tmpfile);
gst_tag_list_free (taglist); gst_tag_list_unref (taglist);
#define IMAGE_ORIENTATION_TAG(t) "taglist," GST_TAG_IMAGE_ORIENTATION "=" t #define IMAGE_ORIENTATION_TAG(t) "taglist," GST_TAG_IMAGE_ORIENTATION "=" t
generate_jif_file_with_tags (IMAGE_ORIENTATION_TAG ("rotate-0"), tmpfile); generate_jif_file_with_tags (IMAGE_ORIENTATION_TAG ("rotate-0"), tmpfile);

View file

@ -362,7 +362,7 @@ GST_START_TEST (test_kate_identification_header)
fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_TITLE, &title)); fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_TITLE, &title));
fail_unless_equals_string (title, "Tiger"); fail_unless_equals_string (title, "Tiger");
g_free (title); g_free (title);
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
gst_message_unref (message); gst_message_unref (message);
/* cleanup */ /* cleanup */

View file

@ -63,7 +63,7 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data)
} }
g_free (fpr); g_free (fpr);
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
found_fingerprint = TRUE; found_fingerprint = TRUE;

View file

@ -154,7 +154,7 @@ on_message (GstBus * bus, GstMessage * message, gpointer data)
g_value_unset (&v); g_value_unset (&v);
} }
gst_tag_list_free (tags); gst_tag_list_unref (tags);
break; break;
} }
default: default:

View file

@ -486,7 +486,7 @@ on_buttonSaveFile_clicked (GtkButton * button, gpointer user_data)
/* view new file */ /* view new file */
if (tag_list) { if (tag_list) {
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
tag_list = NULL; tag_list = NULL;
} }
@ -899,10 +899,10 @@ me_gst_bus_callback_view (GstBus * bus, GstMessage * message, gpointer data)
if (tl) { if (tl) {
ntl = gst_tag_list_merge (tag_list, tl, GST_TAG_MERGE_PREPEND); ntl = gst_tag_list_merge (tag_list, tl, GST_TAG_MERGE_PREPEND);
if (ntl) { if (ntl) {
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
tag_list = ntl; tag_list = ntl;
} }
gst_tag_list_free (tl); gst_tag_list_unref (tl);
} }
} }
/* remove whole chunk tags */ /* remove whole chunk tags */
@ -1314,7 +1314,7 @@ process_file(void)
me_gst_cleanup_elements (); me_gst_cleanup_elements ();
if (tag_list) { if (tag_list) {
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
tag_list = NULL; tag_list = NULL;
} }
@ -1357,7 +1357,7 @@ done:
me_gst_cleanup_elements (); me_gst_cleanup_elements ();
if (tag_list) { if (tag_list) {
gst_tag_list_free (tag_list); gst_tag_list_unref (tag_list);
tag_list = NULL; tag_list = NULL;
} }