audacious-plugins-3.3.3-libcdio.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. diff --git a/src/cdaudio-ng/cdaudio-ng.c b/src/cdaudio-ng/cdaudio-ng.c
  2. index 925b847..e986839 100644
  3. --- a/src/cdaudio-ng/cdaudio-ng.c
  4. +++ b/src/cdaudio-ng/cdaudio-ng.c
  5. @@ -26,11 +26,16 @@
  6. #include <cdio/cdio.h>
  7. #include <cdio/cdtext.h>
  8. #include <cdio/track.h>
  9. -#include <cdio/cdda.h>
  10. #include <cdio/audio.h>
  11. #include <cdio/sector.h>
  12. #include <cdio/cd_types.h>
  13. +#if LIBCDIO_VERSION_NUM >= 90
  14. +#include <cdio/paranoia/cdda.h>
  15. +#else
  16. +#include <cdio/cdda.h>
  17. +#endif
  18. +
  19. /* libcdio's header files #define these */
  20. #undef PACKAGE
  21. #undef PACKAGE_BUGREPORT
  22. @@ -269,9 +274,9 @@ static void cdaudio_set_strinfo (trackinfo_t * t,
  23. const char * performer, const char * name,
  24. const char * genre)
  25. {
  26. - g_strlcpy (t->performer, performer, DEF_STRING_LEN);
  27. - g_strlcpy (t->name, name, DEF_STRING_LEN);
  28. - g_strlcpy (t->genre, genre, DEF_STRING_LEN);
  29. + g_strlcpy (t->performer, performer ? performer : "", DEF_STRING_LEN);
  30. + g_strlcpy (t->name, name ? name : "", DEF_STRING_LEN);
  31. + g_strlcpy (t->genre, genre ? genre : "", DEF_STRING_LEN);
  32. }
  33. /* thread safe (mutex may be locked) */
  34. @@ -622,23 +627,32 @@ static void scan_cd (void)
  35. }
  36. /* get trackinfo[0] cdtext information (the disc) */
  37. + cdtext_t *pcdtext = NULL;
  38. if (aud_get_bool ("CDDA", "use_cdtext"))
  39. {
  40. AUDDBG ("getting cd-text information for disc\n");
  41. - cdtext_t *pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio, 0);
  42. +#if LIBCDIO_VERSION_NUM >= 90
  43. + pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio);
  44. + if (pcdtext == NULL)
  45. +#else
  46. + pcdtext = cdio_get_cdtext (pcdrom_drive->p_cdio, 0);
  47. if (pcdtext == NULL || pcdtext->field[CDTEXT_TITLE] == NULL)
  48. +#endif
  49. {
  50. AUDDBG ("no cd-text available for disc\n");
  51. }
  52. else
  53. {
  54. cdaudio_set_strinfo (&trackinfo[0],
  55. - pcdtext->field[CDTEXT_PERFORMER] ? pcdtext->
  56. - field[CDTEXT_PERFORMER] : "",
  57. - pcdtext->field[CDTEXT_TITLE] ? pcdtext->
  58. - field[CDTEXT_TITLE] : "",
  59. - pcdtext->field[CDTEXT_GENRE] ? pcdtext->
  60. - field[CDTEXT_GENRE] : "");
  61. +#if LIBCDIO_VERSION_NUM >= 90
  62. + cdtext_get(pcdtext, CDTEXT_FIELD_PERFORMER, 0),
  63. + cdtext_get(pcdtext, CDTEXT_FIELD_TITLE, 0),
  64. + cdtext_get(pcdtext, CDTEXT_FIELD_GENRE, 0));
  65. +#else
  66. + pcdtext->field[CDTEXT_PERFORMER],
  67. + pcdtext->field[CDTEXT_TITLE],
  68. + pcdtext->field[CDTEXT_GENRE]);
  69. +#endif
  70. }
  71. }
  72. @@ -646,7 +660,7 @@ static void scan_cd (void)
  73. bool_t cdtext_was_available = FALSE;
  74. for (trackno = firsttrackno; trackno <= lasttrackno; trackno++)
  75. {
  76. - cdtext_t *pcdtext = NULL;
  77. +#if LIBCDIO_VERSION_NUM < 90
  78. if (aud_get_bool ("CDDA", "use_cdtext"))
  79. {
  80. AUDDBG ("getting cd-text information for track %d\n", trackno);
  81. @@ -657,16 +671,20 @@ static void scan_cd (void)
  82. pcdtext = NULL;
  83. }
  84. }
  85. +#endif
  86. if (pcdtext != NULL)
  87. {
  88. cdaudio_set_strinfo (&trackinfo[trackno],
  89. - pcdtext->field[CDTEXT_PERFORMER] ? pcdtext->
  90. - field[CDTEXT_PERFORMER] : "",
  91. - pcdtext->field[CDTEXT_TITLE] ? pcdtext->
  92. - field[CDTEXT_TITLE] : "",
  93. - pcdtext->field[CDTEXT_GENRE] ? pcdtext->
  94. - field[CDTEXT_GENRE] : "");
  95. +#if LIBCDIO_VERSION_NUM >= 90
  96. + cdtext_get(pcdtext, CDTEXT_FIELD_PERFORMER, trackno),
  97. + cdtext_get(pcdtext, CDTEXT_FIELD_TITLE, trackno),
  98. + cdtext_get(pcdtext, CDTEXT_FIELD_GENRE, trackno));
  99. +#else
  100. + pcdtext->field[CDTEXT_PERFORMER],
  101. + pcdtext->field[CDTEXT_TITLE],
  102. + pcdtext->field[CDTEXT_GENRE]);
  103. +#endif
  104. cdtext_was_available = TRUE;
  105. }
  106. else