m_option: don't define OPT_BASE_STRUCT by default

OPT_BASE_STRUCT defines which struct the OPT_ macros (like OPT_INT etc.)
reference implicitly, since these macros take struct member names but no
struct type. Normally, only cfg-mplayer.h should need this, and other
places shouldn't be bothered with having to #undef it.

(Some files, like demux_lavf.c, still store their options in MPOpts. In
the long term, this should be removed, and handled like e.g. with VO
suboptions instead.)
This commit is contained in:
wm4 2013-03-01 11:27:59 +01:00
parent 95b8585d76
commit c9088fff86
10 changed files with 8 additions and 7 deletions

View File

@ -282,6 +282,8 @@ const m_option_t msgl_config[]={
extern const m_option_t lavc_decode_opts_conf[];
#define OPT_BASE_STRUCT struct MPOpts
const m_option_t common_opts[] = {
// ------------------------- common options --------------------
OPT_FLAG("quiet", quiet, CONF_GLOBAL),

View File

@ -518,6 +518,8 @@ int async_quit_request;
static int print_key_list(m_option_t *cfg, char *optname, char *optparam);
static int print_cmd_list(m_option_t *cfg, char *optname, char *optparam);
#define OPT_BASE_STRUCT struct MPOpts
// Our command line options
static const m_option_t input_conf[] = {
OPT_STRING("conf", input.config_file, CONF_GLOBAL),

View File

@ -619,6 +619,4 @@ static inline void m_option_free(const m_option_t *opt, void *dst)
.type = &m_option_type_subconfig_struct, \
.priv = (void*)&subconf)
#define OPT_BASE_STRUCT struct MPOpts
#endif /* MPLAYER_M_OPTION_H */

View File

@ -49,6 +49,8 @@
#define INITIAL_PROBE_SIZE STREAM_BUFFER_SIZE
#define PROBE_BUF_SIZE (2 * 1024 * 1024)
#define OPT_BASE_STRUCT struct MPOpts
const m_option_t lavfdopts_conf[] = {
OPT_INTRANGE("probesize", lavfdopts.probesize, 0, 32, INT_MAX),
OPT_STRING("format", lavfdopts.format, 0),

View File

@ -65,7 +65,6 @@ static const const struct osd_style_opts osd_style_opts_def = {
.margin_y = 10,
};
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct osd_style_opts
const struct m_sub_options osd_style_conf = {
.opts = (m_option_t[]) {

View File

@ -71,6 +71,8 @@ static enum PixelFormat get_format_hwdec(struct AVCodecContext *avctx,
static void uninit(struct sh_video *sh);
#define OPT_BASE_STRUCT struct MPOpts
const m_option_t lavc_decode_opts_conf[] = {
OPT_INTRANGE("bug", lavc_param.workaround_bugs, 0, -1, 999999),
OPT_FLAG("gray", lavc_param.gray, 0),

View File

@ -54,7 +54,6 @@ const struct image_writer_opts image_writer_opts_defaults = {
.jpeg_baseline = 1,
};
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct image_writer_opts
const struct m_sub_options image_writer_conf = {

View File

@ -180,7 +180,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_NOTIMPL;
}
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct priv
const struct vo_driver video_out_image =

View File

@ -1014,7 +1014,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_NOTIMPL;
}
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct priv
const struct vo_driver video_out_sdl = {

View File

@ -1618,7 +1618,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_NOTIMPL;
}
#undef OPT_BASE_STRUCT
#define OPT_BASE_STRUCT struct vdpctx
const struct vo_driver video_out_vdpau = {