summaryrefslogtreecommitdiffstats
authorUoti Urpala <uau@mplayer2.org>2013-01-23 21:39:24 (UTC)
committer Uoti Urpala <uau@mplayer2.org>2013-01-23 21:39:24 (UTC)
commitc5dc8dfe23c58c2a3d554c660c33b40f94ee2db6 (patch) (side-by-side diff)
tree936880b57dfdbf2c8e580b408b16347a9a577fde
parenta16530e63730b4887d8f647c10e4a45d446ee133 (diff)
downloadmplayer2-c5dc8dfe23c58c2a3d554c660c33b40f94ee2db6.tar.bz2
stream_cdda: support latest libcdio version
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--stream/stream_cdda.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 0fcd3db..162cc3d 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -17,9 +17,20 @@
*/
#include "config.h"
+
+#include <cdio/cdio.h>
+
+#if CDIO_API_VERSION < 6
+#define OLD_API
+#endif
+
+#ifdef OLD_API
#include <cdio/cdda.h>
#include <cdio/paranoia.h>
-#include <cdio/cdio.h>
+#else
+#include <cdio/paranoia/cdda.h>
+#include <cdio/paranoia/paranoia.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -116,6 +127,7 @@ const m_option_t cdda_opts[] = {
};
static const char *cdtext_name[] = {
+#ifdef OLD_API
[CDTEXT_ARRANGER] = "Arranger",
[CDTEXT_COMPOSER] = "Composer",
[CDTEXT_MESSAGE] = "Message",
@@ -124,17 +136,35 @@ static const char *cdtext_name[] = {
[CDTEXT_SONGWRITER] = "Songwriter",
[CDTEXT_TITLE] = "Title",
[CDTEXT_UPC_EAN] = "UPC_EAN",
+#else
+ [CDTEXT_FIELD_ARRANGER] = "Arranger",
+ [CDTEXT_FIELD_COMPOSER] = "Composer",
+ [CDTEXT_FIELD_MESSAGE] = "Message",
+ [CDTEXT_FIELD_ISRC] = "ISRC",
+ [CDTEXT_FIELD_PERFORMER] = "Performer",
+ [CDTEXT_FIELD_SONGWRITER] = "Songwriter",
+ [CDTEXT_FIELD_TITLE] = "Title",
+ [CDTEXT_FIELD_UPC_EAN] = "UPC_EAN",
+#endif
};
static bool print_cdtext(stream_t *s, int track)
{
cdda_priv* p = (cdda_priv*)s->priv;
+#ifdef OLD_API
cdtext_t *text = cdio_get_cdtext(p->cd->p_cdio, track);
+#else
+ cdtext_t *text = cdio_get_cdtext(p->cd->p_cdio);
+#endif
if (text) {
mp_msg(MSGT_SEEK, MSGL_INFO, "CD-Text (%s):\n", track ? "track" : "CD");
for (int i = 0; i < sizeof(cdtext_name) / sizeof(cdtext_name[0]); i++) {
const char *name = cdtext_name[i];
+#ifdef OLD_API
const char *value = cdtext_get_const(i, text);
+#else
+ const char *value = cdtext_get_const(text, i, track);
+#endif
if (name && value)
mp_msg(MSGT_SEEK, MSGL_INFO, " %s: '%s'\n", name, value);
}