From 95434268893e7497eb0d936ad607cbd64535b62b Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:53:05 -0500 Subject: [PATCH] options: move dvd options to stream_dvdnav The options and struct are only used in stream_dvdnav.c. Also use dvd prefix for dvd_conf. --- options/options.c | 20 +++----------------- options/options.h | 7 ------- stream/stream_dvdnav.c | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/options/options.c b/options/options.c index 601104e131..625b284ebb 100644 --- a/options/options.c +++ b/options/options.c @@ -88,6 +88,8 @@ extern const struct m_obj_list vo_obj_list; extern const struct m_sub_options ao_conf; +extern const struct m_sub_options dvd_conf; + extern const struct m_sub_options opengl_conf; extern const struct m_sub_options vulkan_conf; extern const struct m_sub_options vulkan_display_conf; @@ -420,22 +422,6 @@ const struct m_sub_options cuda_conf = { }, }; -#undef OPT_BASE_STRUCT -#define OPT_BASE_STRUCT struct dvd_opts - -const struct m_sub_options dvd_conf = { - .opts = (const struct m_option[]){ - {"dvd-device", OPT_STRING(device), .flags = M_OPT_FILE}, - {"dvd-speed", OPT_INT(speed)}, - {"dvd-angle", OPT_INT(angle), M_RANGE(1, 99)}, - {0} - }, - .size = sizeof(struct dvd_opts), - .defaults = &(const struct dvd_opts){ - .angle = 1, - }, -}; - #undef OPT_BASE_STRUCT #define OPT_BASE_STRUCT struct filter_opts @@ -556,7 +542,7 @@ static const m_option_t mp_opts[] = { // ------------------------- stream options -------------------- #if HAVE_DVDNAV - {"", OPT_SUBSTRUCT(dvd_opts, dvd_conf)}, + {"dvd", OPT_SUBSTRUCT(dvd_opts, dvd_conf)}, #endif {"edition", OPT_CHOICE(edition_id, {"auto", -1}), M_RANGE(0, 8190)}, #if HAVE_LIBBLURAY diff --git a/options/options.h b/options/options.h index 14b4f666e6..573dc04002 100644 --- a/options/options.h +++ b/options/options.h @@ -390,12 +390,6 @@ struct cuda_opts { int cuda_device; }; -struct dvd_opts { - int angle; - int speed; - char *device; -}; - struct filter_opts { int deinterlace; int field_parity; @@ -403,7 +397,6 @@ struct filter_opts { extern const struct m_sub_options vo_sub_opts; extern const struct m_sub_options cuda_conf; -extern const struct m_sub_options dvd_conf; extern const struct m_sub_options mp_subtitle_sub_opts; extern const struct m_sub_options mp_subtitle_shared_sub_opts; extern const struct m_sub_options mp_osd_render_sub_opts; diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 5711d7de02..3dd79a7507 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -72,6 +72,27 @@ struct priv { struct dvd_opts *opts; }; +struct dvd_opts { + int angle; + int speed; + char *device; +}; + +#define OPT_BASE_STRUCT struct dvd_opts + +const struct m_sub_options dvd_conf = { + .opts = (const struct m_option[]){ + {"device", OPT_STRING(device), .flags = M_OPT_FILE}, + {"speed", OPT_INT(speed)}, + {"angle", OPT_INT(angle), M_RANGE(1, 99)}, + {0} + }, + .size = sizeof(struct dvd_opts), + .defaults = &(const struct dvd_opts){ + .angle = 1, + }, +}; + #define DNE(e) [e] = # e static const char *const mp_dvdnav_events[] = { DNE(DVDNAV_BLOCK_OK),