mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 10:59:39 +00:00
ext/cdio/: Also extract album title and album genre from CD-TEXT if available (#537021).
Original commit message from CVS: Patch by: Benjamin Kampmann <benjamin at fluendo dot com> * ext/cdio/gstcdio.c: (gst_cdio_get_cdtext), (gst_cdio_add_cdtext_album_tags): * ext/cdio/gstcdio.h: * ext/cdio/gstcdiocddasrc.c: (gst_cdio_cdda_src_open): Also extract album title and album genre from CD-TEXT if available (#537021).
This commit is contained in:
parent
9838809d93
commit
c0da559715
3 changed files with 25 additions and 0 deletions
|
@ -74,6 +74,24 @@ gst_cdio_get_cdtext (GstObject * src, CdIo * cdio, track_t track)
|
|||
return tags;
|
||||
}
|
||||
|
||||
void
|
||||
gst_cdio_add_cdtext_album_tags (GstObject * src, CdIo * cdio, GstTagList * tags)
|
||||
{
|
||||
cdtext_t *t;
|
||||
|
||||
t = cdio_get_cdtext (cdio, 0);
|
||||
if (t == NULL) {
|
||||
GST_DEBUG_OBJECT (src, "no CD-TEXT for album %u");
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: map CDTEXT_PERFORMER to GST_TAG_ALBUM_ARTIST once we have that */
|
||||
gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_ALBUM, &tags);
|
||||
gst_cdio_add_cdtext_field (src, t, CDTEXT_GENRE, GST_TAG_GENRE, &tags);
|
||||
|
||||
GST_DEBUG ("CD-TEXT album tags: %" GST_PTR_FORMAT, tags);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_cdio_log_handler (cdio_log_level_t level, const char *msg)
|
||||
{
|
||||
|
|
|
@ -38,5 +38,9 @@ GstTagList * gst_cdio_get_cdtext (GstObject * src,
|
|||
CdIo * cdio,
|
||||
track_t track);
|
||||
|
||||
void gst_cdio_add_cdtext_album_tags (GstObject * src,
|
||||
CdIo * cdio,
|
||||
GstTagList * tags);
|
||||
|
||||
#endif /* __GST_CDIO_H__ */
|
||||
|
||||
|
|
|
@ -248,6 +248,9 @@ gst_cdio_cdda_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device)
|
|||
if (src->read_speed != -1)
|
||||
cdio_set_speed (src->cdio, src->read_speed);
|
||||
|
||||
gst_cdio_add_cdtext_album_tags (GST_OBJECT_CAST (src), src->cdio,
|
||||
cddabasesrc->tags);
|
||||
|
||||
GST_LOG_OBJECT (src, "%u tracks, first track: %d", num_tracks, first_track);
|
||||
|
||||
for (i = 0; i < num_tracks; ++i) {
|
||||
|
|
Loading…
Reference in a new issue