diff options
author | Joey Zheng <joey@jzheng.org> | 2012-09-08 23:22:23 +0800 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-09-10 21:07:16 +0200 |
commit | d7921ea495107a5aed28ad35bb4151be8d1eb90f (patch) | |
tree | e5f05a85ff2a407721372eadffd210b8b774adfd /plugins | |
parent | 05ec171a0e812fa90dcee6aaa0dbcd0d9d409086 (diff) |
fix building issues with libcdio higher than 0.82
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/cdda/cdda.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index d970e4fe..33f55e13 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -414,7 +414,11 @@ cddb_thread (void *items_i) static void read_track_cdtext (CdIo_t *cdio, int track_nr, DB_playItem_t *item) { +#if LIBCDIO_VERSION_NUM > 82 + cdtext_t *cdtext = cdio_get_cdtext (cdio); +#else cdtext_t *cdtext = cdio_get_cdtext (cdio, 0); +#endif if (!cdtext) { trace ("No cdtext\n"); @@ -425,14 +429,23 @@ read_track_cdtext (CdIo_t *cdio, int track_nr, DB_playItem_t *item) int field_type; for (field_type = 0; field_type < MAX_CDTEXT_FIELDS; field_type++) { +#if LIBCDIO_VERSION_NUM > 82 + const char *text = cdtext_get_const (cdtext, field_type, track_nr); +#else const char *text = cdtext_get_const (field_type, cdtext); +#endif const char *field = NULL; if (text) { switch (field_type) { +#if LIBCDIO_VERSION_NUM > 82 + case CDTEXT_FIELD_TITLE: album = text; break; + case CDTEXT_FIELD_PERFORMER: artist = text; break; +#else case CDTEXT_TITLE: album = text; break; case CDTEXT_PERFORMER: artist = text; break; +#endif } } } @@ -445,24 +458,41 @@ read_track_cdtext (CdIo_t *cdio, int track_nr, DB_playItem_t *item) deadbeef->pl_replace_meta (item, "album", album); } +#if LIBCDIO_VERSION_NUM > 82 + cdtext = cdio_get_cdtext (cdio); +#else cdtext = cdio_get_cdtext (cdio, track_nr); +#endif if (!cdtext) return; for (field_type = 0; field_type < MAX_CDTEXT_FIELDS; field_type++) { +#if LIBCDIO_VERSION_NUM > 82 + const char *text = cdtext_get_const (cdtext, field_type, track_nr); +#else const char *text = cdtext_get_const (field_type, cdtext); +#endif const char *field = NULL; if (!text) continue; switch (field_type) { +#if LIBCDIO_VERSION_NUM > 82 + case CDTEXT_FIELD_TITLE: field = "title"; break; + case CDTEXT_FIELD_PERFORMER: field = "artist"; break; + case CDTEXT_FIELD_COMPOSER: field = "composer"; break; + case CDTEXT_FIELD_GENRE: field = "genre"; break; + case CDTEXT_FIELD_SONGWRITER: field = "songwriter"; break; + case CDTEXT_FIELD_MESSAGE: field = "comment"; break; +#else case CDTEXT_TITLE: field = "title"; break; case CDTEXT_PERFORMER: field = "artist"; break; case CDTEXT_COMPOSER: field = "composer"; break; case CDTEXT_GENRE: field = "genre"; break; case CDTEXT_SONGWRITER: field = "songwriter"; break; case CDTEXT_MESSAGE: field = "comment"; break; +#endif default: field = NULL; } if (field && text) @@ -477,7 +507,11 @@ static int read_disc_cdtext (struct cddb_thread_params *params) { DB_playItem_t **items = params->items; +#if LIBCDIO_VERSION_NUM > 82 + cdtext_t *cdtext = cdio_get_cdtext (params->cdio); +#else cdtext_t *cdtext = cdio_get_cdtext (params->cdio, 0); +#endif if (!cdtext) return 0; |