Skip to content

Commit

Permalink
options: move dvd options to stream_dvdnav
Browse files Browse the repository at this point in the history
The options and struct are only used in stream_dvdnav.c.
Also use dvd prefix for dvd_conf.
  • Loading branch information
na-na-hi committed Nov 14, 2024
1 parent d8bfd24 commit 40ae2fc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
20 changes: 3 additions & 17 deletions options/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions options/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,13 @@ struct cuda_opts {
int cuda_device;
};

struct dvd_opts {
int angle;
int speed;
char *device;
};

struct filter_opts {
int deinterlace;
int field_parity;
};

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;
Expand Down
21 changes: 21 additions & 0 deletions stream/stream_dvdnav.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 40ae2fc

Please sign in to comment.