summaryrefslogtreecommitdiffstats
path: root/ext/taglib
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-08-16 13:01:32 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-08-16 13:01:32 +0000
commit81d46b82779e8672b48d5cc3e94d59e54838afd8 (patch)
tree13e6fc0e488d38557cd985f5b852dae3a6b069a7 /ext/taglib
parente501141c7598a12e2e0798484f96d4efe6961de7 (diff)
configure.ac: Require CVS of GStreamer core and -base (for
Original commit message from CVS: * configure.ac: Require CVS of GStreamer core and -base (for GST_TAG_EXTENDED_COMMENT and gst_tag_parse_extended_comment()). * ext/taglib/gstid3v2mux.cc: Write extended comment tags properly (#348762). * gst/id3demux/id3v2frames.c: (id3demux_id3v2_parse_frame), (parse_comment_frame): Extract COMM frames into extended comments, which makes it easier to properly retain the description bit of the tag and maintain this information when re-tagging (#348762).
Diffstat (limited to 'ext/taglib')
-rw-r--r--ext/taglib/gstid3v2mux.cc28
1 files changed, 21 insertions, 7 deletions
diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc
index 00a4c3fa..a6dbd2b1 100644
--- a/ext/taglib/gstid3v2mux.cc
+++ b/ext/taglib/gstid3v2mux.cc
@@ -458,21 +458,34 @@ add_comment_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
if (gst_tag_list_get_string_index (list, tag, n, &s) && s != NULL) {
ID3v2::CommentsFrame * f;
- gchar *desc;
+ gchar *desc = NULL, *val = NULL, *lang = NULL;
- GST_LOG ("%s[%u] = '%s'", tag, n, s);
f = new ID3v2::CommentsFrame (String::UTF8);
- /* FIXME: we should somehow try to preserve the original descriptions */
- desc = g_strdup_printf ("c%u", n);
+ if (strcmp (tag, GST_TAG_COMMENT) == 0 ||
+ !gst_tag_parse_extended_comment (s, &desc, &lang, &val, TRUE)) {
+ /* create dummy description to allow for multiple comment frames
+ * (taglib will drop comment frames if descriptions are not unique) */
+ desc = g_strdup_printf ("c%u", n);
+ val = g_strdup (s);
+ }
+
+ GST_LOG ("%s[%u] = '%s' (%s|%s|%s)", tag, n, s, GST_STR_NULL (desc),
+ GST_STR_NULL (lang), GST_STR_NULL (val));
+
f->setDescription (desc);
- g_free (desc);
+ f->setText (val);
+ if (lang) {
+ f->setLanguage (lang);
+ }
- f->setText (s);
- g_free (s);
+ g_free (lang);
+ g_free (desc);
+ g_free (val);
id3v2tag->addFrame (f);
}
+ g_free (s);
}
}
@@ -520,6 +533,7 @@ static const struct
GST_TAG_COPYRIGHT, add_text_tag, "TCOP"}, {
GST_TAG_GENRE, add_text_tag, "TCON"}, {
GST_TAG_COMMENT, add_comment_tag, ""}, {
+ GST_TAG_EXTENDED_COMMENT, add_comment_tag, ""}, {
GST_TAG_DATE, add_date_tag, ""}, {
GST_TAG_IMAGE, add_image_tag, ""}, {
GST_TAG_PREVIEW_IMAGE, add_image_tag, ""}, {