diff --git a/meson.build b/meson.build index d6c76f3b08..ca3df9f1f0 100644 --- a/meson.build +++ b/meson.build @@ -590,10 +590,11 @@ cdda_opt = get_option('cdda').require( get_option('gpl'), error_message: 'the build is not GPL!', ) +cdio = dependency('libcdio', version: '>= 0.90', required: cdda_opt) cdda = dependency('libcdio_paranoia', required: cdda_opt) -features += {'cdda': cdda.found()} +features += {'cdda': cdda.found() and cdio.found()} if features['cdda'] - dependencies += cdda + dependencies += [cdda, cdio] sources += files('stream/stream_cdda.c') endif diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index 2ee1af3ddb..f73c84a0da 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -17,29 +17,21 @@ * with mpv. If not, see . */ -#include "config.h" +#include +#include +#include #include -#if CDIO_API_VERSION < 6 -#define OLD_API -#endif - +// For cdio_cddap_version #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" -#ifdef OLD_API -#include -#include -#else #include #include -#endif #pragma GCC diagnostic pop -#include -#include -#include - +#include "common/msg.h" +#include "config.h" #include "mpv_talloc.h" #include "stream.h" @@ -47,9 +39,6 @@ #include "options/m_config.h" #include "options/options.h" -#include "common/msg.h" - -#include "config.h" #if !HAVE_GPL #error GPL only #endif @@ -101,16 +90,6 @@ const struct m_sub_options stream_cdda_conf = { }; static const char *const cdtext_name[] = { -#ifdef OLD_API - [CDTEXT_ARRANGER] = "Arranger", - [CDTEXT_COMPOSER] = "Composer", - [CDTEXT_MESSAGE] = "Message", - [CDTEXT_ISRC] = "ISRC", - [CDTEXT_PERFORMER] = "Performer", - [CDTEXT_SONGWRITER] = "Songwriter", - [CDTEXT_TITLE] = "Title", - [CDTEXT_UPC_EAN] = "UPC_EAN", -#else [CDTEXT_FIELD_ARRANGER] = "Arranger", [CDTEXT_FIELD_COMPOSER] = "Composer", [CDTEXT_FIELD_MESSAGE] = "Message", @@ -119,7 +98,6 @@ static const char *const cdtext_name[] = { [CDTEXT_FIELD_SONGWRITER] = "Songwriter", [CDTEXT_FIELD_TITLE] = "Title", [CDTEXT_FIELD_UPC_EAN] = "UPC_EAN", -#endif }; static void print_cdtext(stream_t *s, int track) @@ -127,20 +105,12 @@ static void print_cdtext(stream_t *s, int track) cdda_priv* p = (cdda_priv*)s->priv; if (!p->cdtext) return; -#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 int header = 0; if (text) { 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) { if (!header) MP_INFO(s, "CD-Text (%s):\n", track ? "track" : "CD");