ext/flac/gstflacdec.c: Use libgsttag helper function here too.

Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_dec_update_metadata):
Use libgsttag helper function here too.
This commit is contained in:
Tim-Philipp Müller 2006-08-24 10:03:03 +00:00
parent 424ea70f58
commit 3b826d41db
2 changed files with 18 additions and 15 deletions

View file

@ -1,3 +1,8 @@
2006-08-24 Tim-Philipp Müller <tim at centricular dot net>
* ext/flac/gstflacdec.c: (gst_flac_dec_update_metadata):
Use libgsttag helper function here too.
2006-08-23 Stefan Kost <ensonic@users.sf.net>
* gst/avi/gstavidemux.c: (gst_avi_demux_class_init),

View file

@ -301,31 +301,29 @@ gst_flac_dec_update_metadata (GstFlacDec * flacdec,
const FLAC__StreamMetadata * metadata)
{
GstTagList *list;
guint32 number_of_comments, cursor, str_len;
gchar *p_value, *value, *name, *str_ptr;
guint num, i;
list = gst_tag_list_new ();
if (list == NULL) {
return FALSE;
}
number_of_comments = metadata->data.vorbis_comment.num_comments;
value = NULL;
GST_DEBUG ("%d tag(s) found", number_of_comments);
for (cursor = 0; cursor < number_of_comments; cursor++) {
str_ptr = (gchar *) metadata->data.vorbis_comment.comments[cursor].entry;
str_len = metadata->data.vorbis_comment.comments[cursor].length;
p_value = g_strstr_len (str_ptr, str_len, "=");
if (p_value) {
name = g_strndup (str_ptr, p_value - str_ptr);
value = g_strndup (p_value + 1, str_ptr + str_len - p_value - 1);
num = metadata->data.vorbis_comment.num_comments;
GST_DEBUG ("%u tag(s) found", num);
for (i = 0; i < num; ++i) {
gchar *vc, *name, *value;
vc = g_strndup ((gchar *) metadata->data.vorbis_comment.comments[i].entry,
metadata->data.vorbis_comment.comments[i].length);
if (gst_tag_parse_extended_comment (vc, &name, NULL, &value, TRUE)) {
GST_DEBUG ("%s : %s", name, value);
gst_vorbis_tag_add (list, name, value);
g_free (name);
g_free (value);
}
g_free (vc);
}
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, "FLAC", NULL);