123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- diff --git a/src/cdaudio-ng/cdaudio-ng.c b/src/cdaudio-ng/cdaudio-ng.c
- index 925b847..e986839 100644
- --- a/src/cdaudio-ng/cdaudio-ng.c
- +++ b/src/cdaudio-ng/cdaudio-ng.c
- @@ -26,11 +26,16 @@
- #include <cdio/cdio.h>
- #include <cdio/cdtext.h>
- #include <cdio/track.h>
- -#include <cdio/cdda.h>
- #include <cdio/audio.h>
- #include <cdio/sector.h>
- #include <cdio/cd_types.h>
- +#if LIBCDIO_VERSION_NUM >= 90
- +#include <cdio/paranoia/cdda.h>
- +#else
- +#include <cdio/cdda.h>
- +#endif
- +
- /* libcdio's header files #define these */
- #undef PACKAGE
- #undef PACKAGE_BUGREPORT
- @@ -269,9 +274,9 @@ static void cdaudio_set_strinfo (trackinfo_t * t,
- const char * performer, const char * name,
- const char * genre)
- {
- - g_strlcpy (t->performer, performer, DEF_STRING_LEN);
- - g_strlcpy (t->name, name, DEF_STRING_LEN);
- - g_strlcpy (t->genre, genre, DEF_STRING_LEN);
- + g_strlcpy (t->performer, performer ? performer : "", DEF_STRING_LEN);
- + g_strlcpy (t->name, name ? name : "", DEF_STRING_LEN);
- + g_strlcpy (t->genre, genre ? genre : "", DEF_STRING_LEN);
- }
- /* thread safe (mutex may be locked) */
- @@ -622,23 +627,32 @@ static void scan_cd (void)
- }
- /* get trackinfo[0] cdtext information (the disc) */
- + cdtext_t *pcdtext = NULL;
- if (aud_get_bool ("CDDA", "use_cdtext"))
- {
- AUDDBG ("getting cd-text information for disc\n");
- - cdtext_t *pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio, 0);
- +#if LIBCDIO_VERSION_NUM >= 90
- + pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio);
- + if (pcdtext == NULL)
- +#else
- + pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio, 0);
- if (pcdtext == NULL || pcdtext->field[CDTEXT_TITLE] == NULL)
- +#endif
- {
- AUDDBG ("no cd-text available for disc\n");
- }
- else
- {
- cdaudio_set_strinfo (&trackinfo[0],
- - pcdtext->field[CDTEXT_PERFORMER] ? pcdtext->
- - field[CDTEXT_PERFORMER] : "",
- - pcdtext->field[CDTEXT_TITLE] ? pcdtext->
- - field[CDTEXT_TITLE] : "",
- - pcdtext->field[CDTEXT_GENRE] ? pcdtext->
- - field[CDTEXT_GENRE] : "");
- +#if LIBCDIO_VERSION_NUM >= 90
- + cdtext_get(pcdtext, CDTEXT_FIELD_PERFORMER, 0),
- + cdtext_get(pcdtext, CDTEXT_FIELD_TITLE, 0),
- + cdtext_get(pcdtext, CDTEXT_FIELD_GENRE, 0));
- +#else
- + pcdtext->field[CDTEXT_PERFORMER],
- + pcdtext->field[CDTEXT_TITLE],
- + pcdtext->field[CDTEXT_GENRE]);
- +#endif
- }
- }
- @@ -646,7 +660,7 @@ static void scan_cd (void)
- bool_t cdtext_was_available = FALSE;
- for (trackno = firsttrackno; trackno <= lasttrackno; trackno++)
- {
- - cdtext_t *pcdtext = NULL;
- +#if LIBCDIO_VERSION_NUM < 90
- if (aud_get_bool ("CDDA", "use_cdtext"))
- {
- AUDDBG ("getting cd-text information for track %d\n", trackno);
- @@ -657,16 +671,20 @@ static void scan_cd (void)
- pcdtext = NULL;
- }
- }
- +#endif
- if (pcdtext != NULL)
- {
- cdaudio_set_strinfo (&trackinfo[trackno],
- - pcdtext->field[CDTEXT_PERFORMER] ? pcdtext->
- - field[CDTEXT_PERFORMER] : "",
- - pcdtext->field[CDTEXT_TITLE] ? pcdtext->
- - field[CDTEXT_TITLE] : "",
- - pcdtext->field[CDTEXT_GENRE] ? pcdtext->
- - field[CDTEXT_GENRE] : "");
- +#if LIBCDIO_VERSION_NUM >= 90
- + cdtext_get(pcdtext, CDTEXT_FIELD_PERFORMER, trackno),
- + cdtext_get(pcdtext, CDTEXT_FIELD_TITLE, trackno),
- + cdtext_get(pcdtext, CDTEXT_FIELD_GENRE, trackno));
- +#else
- + pcdtext->field[CDTEXT_PERFORMER],
- + pcdtext->field[CDTEXT_TITLE],
- + pcdtext->field[CDTEXT_GENRE]);
- +#endif
- cdtext_was_available = TRUE;
- }
- else
|