summaryrefslogtreecommitdiffstats
path: root/stream/stream_cdda.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-19 16:14:24 -0500
committerDudemanguy <random342@airmail.cc>2023-09-22 14:20:38 +0000
commit6ea9ec9931d3cb65f812b79fec6c14eab7d05070 (patch)
tree6893483f646ad0a17ab6ee1e9e8e92f4dcc89cde /stream/stream_cdda.c
parentb2edd4312d06de7ced543e2e389c1e3866c27755 (diff)
downloadmpv-6ea9ec9931d3cb65f812b79fec6c14eab7d05070.tar.bz2
mpv-6ea9ec9931d3cb65f812b79fec6c14eab7d05070.tar.xz
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.
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r--stream/stream_cdda.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index a0de09b6d1..0ad082c114 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -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;
}