1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-27 10:50:53 +00:00

stream_cdda: move cdrom-device to cdda_params

There is zero reason for this to be an MPOpt. Because of how the
OPT_SUBSTRACT works, the option gets renamed to cdda-device instead, but
probably not a big deal since the old alias is still in place.
This commit is contained in:
Dudemanguy 2023-09-19 16:14:24 -05:00
parent b2edd4312d
commit 6ea9ec9931
5 changed files with 8 additions and 11 deletions

View File

@ -89,6 +89,7 @@ Interface changes
instead)
- add `--title-bar` option
- add `--window-corners` option
- rename `--cdrom-device` to `--cdda-device`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -3472,8 +3472,8 @@ Window
Disc Devices
------------
``--cdrom-device=<path>``
Specify the CD-ROM device (default: ``/dev/cdrom``).
``--cdda-device=<path>``
Specify the CD device for CDDA playback (default: ``/dev/cdrom``).
``--dvd-device=<path>``
Specify the DVD device or .iso filename (default: ``/dev/dvd``). You can

View File

@ -547,7 +547,7 @@ static const m_option_t mp_opts[] = {
#if HAVE_CDDA
{"cdda", OPT_SUBSTRUCT(stream_cdda_opts, stream_cdda_conf)},
{"cdrom-device", OPT_STRING(cdrom_device), .flags = M_OPT_FILE},
{"cdrom-device", OPT_REPLACED("cdda-device")},
#endif
// demuxer.c - select audio/sub file/demuxer

View File

@ -325,7 +325,6 @@ typedef struct MPOpts {
struct dvb_params *stream_dvb_opts;
struct stream_lavf_params *stream_lavf_opts;
char *cdrom_device;
char *bluray_device;
struct demux_rawaudio_opts *demux_rawaudio;

View File

@ -61,6 +61,7 @@ typedef struct cdda_params {
size_t data_pos;
// options
char *cdda_device;
int speed;
int paranoia_mode;
int sector_size;
@ -76,6 +77,7 @@ typedef struct cdda_params {
#define OPT_BASE_STRUCT struct cdda_params
const struct m_sub_options stream_cdda_conf = {
.opts = (const m_option_t[]) {
{"device", OPT_STRING(cdda_device), .flags = M_OPT_FILE},
{"speed", OPT_INT(speed), M_RANGE(1, 100)},
{"paranoia", OPT_INT(paranoia_mode), M_RANGE(0, 2)},
{"sector-size", OPT_INT(sector_size), M_RANGE(1, 100)},
@ -286,15 +288,10 @@ static int open_cdda(stream_t *st)
cdrom_drive_t *cdd = NULL;
int last_track;
char *global_device;
mp_read_option_raw(st->global, "cdrom-device", &m_option_type_string,
&global_device);
talloc_steal(st, global_device);
if (st->path[0]) {
p->device = st->path;
} else if (global_device && global_device[0]) {
p->device = global_device;
} else if (p->cdda_device && p->cdda_device[0]) {
p->device = p->cdda_device;
} else {
p->device = DEFAULT_CDROM_DEVICE;
}