mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
ext/taglib/gstid3v2mux.cc: Handle writing of track-count or album-volume-count without track-number or albume-volume...
Original commit message from CVS: * ext/taglib/gstid3v2mux.cc: Handle writing of track-count or album-volume-count without track-number or albume-volume-number (in this case the number will just be set to 0). * tests/check/elements/id3v2mux.c: (test_taglib_id3mux_check_tags): It would be nice if we actually checked the values received for track/album-volume number/count in _check_tags(), rather than setting them again ...
This commit is contained in:
parent
e4bb4b892f
commit
c4b1e8e4ae
4 changed files with 76 additions and 9 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2006-05-28 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* ext/taglib/gstid3v2mux.cc:
|
||||
Handle writing of track-count or album-volume-count without
|
||||
track-number or albume-volume-number (in this case the number
|
||||
will just be set to 0).
|
||||
|
||||
* tests/check/elements/id3v2mux.c: (test_taglib_id3mux_check_tags):
|
||||
It would be nice if we actually checked the values received for
|
||||
track/album-volume number/count in _check_tags(), rather than
|
||||
setting them again ...
|
||||
|
||||
2006-05-28 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/id3demux/id3v2frames.c: (id3v2_tag_to_taglist):
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 764c5f25101d20da7f26942c36ba840ba65c63d7
|
||||
Subproject commit 325a1848e38c12e0e787baa70e7b9aacf20ee799
|
|
@ -230,6 +230,23 @@ add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
|
|||
id3v2tag->setTrack (track_number);
|
||||
}
|
||||
}
|
||||
} else if (strcmp (tag, GST_TAG_TRACK_COUNT) == 0) {
|
||||
guint n;
|
||||
|
||||
if (gst_tag_list_get_uint_index (list, GST_TAG_TRACK_NUMBER, 0, &n)) {
|
||||
GST_DEBUG ("track-count handled with track-number, skipping");
|
||||
} else if (gst_tag_list_get_uint_index (list, GST_TAG_TRACK_COUNT, 0, &n)) {
|
||||
ID3v2::TextIdentificationFrame * frame;
|
||||
gchar *tag_str;
|
||||
|
||||
frame = new ID3v2::TextIdentificationFrame ("TRCK", String::UTF8);
|
||||
tag_str = g_strdup_printf ("0/%u", n);
|
||||
GST_DEBUG ("Setting track number/count to %s", tag_str);
|
||||
|
||||
id3v2tag->addFrame (frame);
|
||||
frame->setText (tag_str);
|
||||
g_free (tag_str);
|
||||
}
|
||||
} else if (strcmp (tag, GST_TAG_ALBUM_VOLUME_NUMBER) == 0) {
|
||||
guint volume_number;
|
||||
|
||||
|
@ -252,6 +269,24 @@ add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
|
|||
|
||||
GST_DEBUG ("Setting album number to %s", tag_str);
|
||||
|
||||
id3v2tag->addFrame (frame);
|
||||
frame->setText (tag_str);
|
||||
g_free (tag_str);
|
||||
}
|
||||
} else if (strcmp (tag, GST_TAG_ALBUM_VOLUME_COUNT) == 0) {
|
||||
guint n;
|
||||
|
||||
if (gst_tag_list_get_uint_index (list, GST_TAG_ALBUM_VOLUME_NUMBER, 0, &n)) {
|
||||
GST_DEBUG ("volume-count handled with volume-number, skipping");
|
||||
} else if (gst_tag_list_get_uint_index (list, GST_TAG_ALBUM_VOLUME_COUNT,
|
||||
0, &n)) {
|
||||
ID3v2::TextIdentificationFrame * frame;
|
||||
gchar *tag_str;
|
||||
|
||||
frame = new ID3v2::TextIdentificationFrame ("TPOS", String::UTF8);
|
||||
tag_str = g_strdup_printf ("0/%u", n);
|
||||
GST_DEBUG ("Setting album volume number/count to %s", tag_str);
|
||||
|
||||
id3v2tag->addFrame (frame);
|
||||
frame->setText (tag_str);
|
||||
g_free (tag_str);
|
||||
|
|
|
@ -136,25 +136,45 @@ test_taglib_id3mux_check_tags (GstTagList * tags, guint32 mask)
|
|||
g_date_free (date);
|
||||
}
|
||||
if (mask & (1 << 4)) {
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_KEEP,
|
||||
GST_TAG_TRACK_NUMBER, TEST_TRACK_NUMBER, NULL);
|
||||
guint num;
|
||||
|
||||
fail_unless (gst_tag_list_get_uint (tags, GST_TAG_TRACK_NUMBER, &num));
|
||||
fail_unless (num == TEST_TRACK_NUMBER);
|
||||
}
|
||||
if (mask & (1 << 5)) {
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_KEEP,
|
||||
GST_TAG_TRACK_COUNT, TEST_TRACK_COUNT, NULL);
|
||||
guint count;
|
||||
|
||||
fail_unless (gst_tag_list_get_uint (tags, GST_TAG_TRACK_COUNT, &count));
|
||||
fail_unless (count == TEST_TRACK_COUNT);
|
||||
}
|
||||
if (mask & (1 << 6)) {
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_KEEP,
|
||||
GST_TAG_ALBUM_VOLUME_NUMBER, TEST_VOLUME_NUMBER, NULL);
|
||||
guint num;
|
||||
|
||||
fail_unless (gst_tag_list_get_uint (tags, GST_TAG_ALBUM_VOLUME_NUMBER,
|
||||
&num));
|
||||
fail_unless (num == TEST_VOLUME_NUMBER);
|
||||
}
|
||||
if (mask & (1 << 7)) {
|
||||
gst_tag_list_add (tags, GST_TAG_MERGE_KEEP,
|
||||
GST_TAG_ALBUM_VOLUME_COUNT, TEST_VOLUME_COUNT, NULL);
|
||||
guint count;
|
||||
|
||||
fail_unless (gst_tag_list_get_uint (tags, GST_TAG_ALBUM_VOLUME_COUNT,
|
||||
&count));
|
||||
fail_unless (count == TEST_VOLUME_COUNT);
|
||||
}
|
||||
#if 0
|
||||
if (mask & (1 << 8)) {
|
||||
gdouble gain;
|
||||
|
||||
fail_unless (gst_tag_list_get_double (tags, GST_TAG_TRACK_GAIN, &gain));
|
||||
fail_unless (gain == TEST_TRACK_GAIN);
|
||||
}
|
||||
if (mask & (1 << 9)) {
|
||||
gdouble gain;
|
||||
|
||||
fail_unless (gst_tag_list_get_double (tags, GST_TAG_ALBUM_GAIN, &gain));
|
||||
fail_unless (gain == TEST_ALBUM_GAIN);
|
||||
}
|
||||
#endif
|
||||
if (mask & (1 << 10)) {
|
||||
}
|
||||
if (mask & (1 << 11)) {
|
||||
|
|
Loading…
Reference in a new issue