stream_cdda: remove fallback for ancient libcdio versions

CDIO_API_VERSION 6 has been around since libcdio 0.90. That was release
over a decade ago. There's literally no reason to keep the ugly mess of
the old api around so remove it.
This commit is contained in:
Dudemanguy
2023-10-18 11:16:51 -05:00
parent bd1ba99ab2
commit d5e5c2ce98
2 changed files with 9 additions and 38 deletions

View File

@@ -17,29 +17,21 @@
* with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <cdio/cdio.h>
#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 <cdio/cdda.h>
#include <cdio/paranoia.h>
#else
#include <cdio/paranoia/cdda.h>
#include <cdio/paranoia/paranoia.h>
#endif
#pragma GCC diagnostic pop
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#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");