Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
gstreamer-0_10-plugins-ugly
gstreamer-0_10-plugins-ugly-0.10.19-new_libcdio...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gstreamer-0_10-plugins-ugly-0.10.19-new_libcdio.patch of Package gstreamer-0_10-plugins-ugly
Rebased from original commit 649bd92cd2600719862ad5189899212409dd0a67 Author: Leon Merten Lohse <leon@green-side.de> Date: Thu May 3 23:50:30 2012 +0100 cdio: compensate for libcdio's recent cd-text api changes https://bugzilla.gnome.org/show_bug.cgi?id=675112 Conflicts: ext/cdio/gstcdiocddasrc.c Index: b/ext/cdio/gstcdio.c =================================================================== --- a/ext/cdio/gstcdio.c +++ b/ext/cdio/gstcdio.c @@ -28,16 +28,20 @@ #include <cdio/logging.h> GST_DEBUG_CATEGORY (gst_cdio_debug); void -gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext, +gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext, track_t track, cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags) { const gchar *txt; +#if LIBCDIO_VERSION_NUM > 83 + txt = cdtext_get_const (cdtext, field, track); +#else txt = cdtext_get_const (field, cdtext); +#endif if (txt == NULL || *txt == '\0') { GST_DEBUG_OBJECT (src, "empty CD-TEXT field %u (%s)", field, gst_tag); return; } @@ -55,42 +59,59 @@ gst_cdio_add_cdtext_field (GstObject * s GST_DEBUG_OBJECT (src, "CD-TEXT: %s = %s", gst_tag, txt); } GstTagList * +#if LIBCDIO_VERSION_NUM > 83 +gst_cdio_get_cdtext (GstObject * src, cdtext_t * t, track_t track) +{ + GstTagList *tags = NULL; + +#else gst_cdio_get_cdtext (GstObject * src, CdIo * cdio, track_t track) { GstTagList *tags = NULL; cdtext_t *t; t = cdio_get_cdtext (cdio, track); if (t == NULL) { GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", track); return NULL; } +#endif - gst_cdio_add_cdtext_field (src, t, CDTEXT_PERFORMER, GST_TAG_ARTIST, &tags); - gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_TITLE, &tags); + gst_cdio_add_cdtext_field (src, t, track, CDTEXT_FIELD_PERFORMER, + GST_TAG_ARTIST, &tags); + gst_cdio_add_cdtext_field (src, t, track, CDTEXT_FIELD_TITLE, GST_TAG_TITLE, + &tags); return tags; } void +#if LIBCDIO_VERSION_NUM > 83 +gst_cdio_add_cdtext_album_tags (GstObject * src, cdtext_t * t, + GstTagList * tags) +{ +#else 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"); return; } +#endif - /* 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_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_PERFORMER, + GST_TAG_ALBUM_ARTIST, &tags); + gst_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_TITLE, GST_TAG_ALBUM, + &tags); + gst_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_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) Index: b/ext/cdio/gstcdio.h =================================================================== --- a/ext/cdio/gstcdio.h +++ b/ext/cdio/gstcdio.h @@ -22,25 +22,41 @@ #define __GST_CDIO_H__ #include <gst/gst.h> #include <cdio/cdio.h> #include <cdio/cdtext.h> +#include <cdio/version.h> + +#if LIBCDIO_VERSION_NUM <= 83 + #define CDTEXT_FIELD_PERFORMER CDTEXT_PERFORMER + #define CDTEXT_FIELD_GENRE CDTEXT_GENRE + #define CDTEXT_FIELD_TITLE CDTEXT_TITLE +#endif GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug); #define GST_CAT_DEFAULT gst_cdio_debug void gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext, + track_t track, cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags); GstTagList * gst_cdio_get_cdtext (GstObject * src, +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t * t, +#else CdIo * cdio, +#endif track_t track); void gst_cdio_add_cdtext_album_tags (GstObject * src, +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t * t, +#else CdIo * cdio, +#endif GstTagList * tags); #endif /* __GST_CDIO_H__ */ Index: b/ext/cdio/gstcdiocddasrc.c =================================================================== --- a/ext/cdio/gstcdiocddasrc.c +++ b/ext/cdio/gstcdiocddasrc.c @@ -216,10 +216,13 @@ static gboolean gst_cdio_cdda_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device) { GstCdioCddaSrc *src; discmode_t discmode; gint first_track, num_tracks, i; +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t *cdtext; +#endif src = GST_CDIO_CDDA_SRC (cddabasesrc); g_assert (device != NULL); g_assert (src->cdio == NULL); @@ -242,12 +245,22 @@ gst_cdio_cdda_src_open (GstCddaBaseSrc * return TRUE; /* base class will generate 'has no tracks' error */ if (src->read_speed != -1) cdio_set_speed (src->cdio, src->read_speed); +#if LIBCDIO_VERSION_NUM > 83 + cdtext = cdio_get_cdtext (src->cdio); + + if (NULL == cdtext) + GST_DEBUG_OBJECT (src, "no CD-TEXT on disc"); + else + gst_cdio_add_cdtext_album_tags (GST_OBJECT_CAST (src), cdtext, + cddabasesrc->tags); +#else gst_cdio_add_cdtext_album_tags (GST_OBJECT_CAST (src), src->cdio, cddabasesrc->tags); +#endif GST_LOG_OBJECT (src, "%u tracks, first track: %d", num_tracks, first_track); for (i = 0; i < num_tracks; ++i) { GstCddaBaseSrcTrack track = { 0, }; @@ -260,12 +273,18 @@ gst_cdio_cdda_src_open (GstCddaBaseSrc * /* Note: LSN/LBA confusion all around us; in any case, this does * the right thing here (for cddb id calculations etc. as well) */ track.start = cdio_get_track_lsn (src->cdio, i + first_track); track.end = track.start + len_sectors - 1; /* -1? */ +#if LIBCDIO_VERSION_NUM > 83 + if (NULL != cdtext) + track.tags = gst_cdio_get_cdtext (GST_OBJECT (src), cdtext, + i + first_track); +#else track.tags = gst_cdio_get_cdtext (GST_OBJECT (src), src->cdio, i + first_track); +#endif gst_cdda_base_src_add_track (GST_CDDA_BASE_SRC (src), &track); } return TRUE;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor