summaryrefslogtreecommitdiffstats
path: root/filters/f_decoder_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'filters/f_decoder_wrapper.c')
-rw-r--r--filters/f_decoder_wrapper.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c
index 6b297b671f..b49ec921c1 100644
--- a/filters/f_decoder_wrapper.c
+++ b/filters/f_decoder_wrapper.c
@@ -63,10 +63,10 @@ struct dec_queue_opts {
#define OPT_BASE_STRUCT struct dec_queue_opts
static const struct m_option dec_queue_opts_list[] = {
- OPT_FLAG("enable", use_queue, 0),
- OPT_DOUBLE("max-secs", max_duration, 0, .min = 0, .max = DBL_MAX),
- OPT_BYTE_SIZE("max-bytes", max_bytes, 0, 0, (size_t)-1),
- OPT_INT64("max-samples", max_samples, 0, .min = 0, .max = DBL_MAX),
+ {"enable", OPT_FLAG(use_queue)},
+ {"max-secs", OPT_DOUBLE(max_duration), M_RANGE(0, DBL_MAX)},
+ {"max-bytes", OPT_BYTE_SIZE(max_bytes), M_RANGE(0, (size_t)-1)},
+ {"max-samples", OPT_INT64(max_samples), M_RANGE(0, DBL_MAX)},
{0}
};
@@ -115,21 +115,24 @@ static int decoder_list_opt(struct mp_log *log, const m_option_t *opt,
const struct m_sub_options dec_wrapper_conf = {
.opts = (const struct m_option[]){
- OPT_FLAG("correct-pts", correct_pts, 0),
- OPT_DOUBLE("fps", force_fps, 0, .min = 0, .max = DBL_MAX),
- OPT_STRING_VALIDATE("ad", audio_decoders, 0, decoder_list_opt),
- OPT_STRING_VALIDATE("vd", video_decoders, 0, decoder_list_opt),
- OPT_STRING_VALIDATE("audio-spdif", audio_spdif, 0, decoder_list_opt),
- OPT_CHOICE_OR_INT("video-rotate", video_rotate, UPDATE_IMGPAR, 0, 359,
- ({"no", -1})),
- OPT_ASPECT("video-aspect-override", movie_aspect,
- UPDATE_IMGPAR, .min = -1, .max = 10),
- OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR,
- ({"bitstream", 1}, {"container", 2})),
- OPT_SUBSTRUCT("vd-queue", vdec_queue_opts, vdec_queue_conf, 0),
- OPT_SUBSTRUCT("ad-queue", adec_queue_opts, adec_queue_conf, 0),
- OPT_BYTE_SIZE("video-reversal-buffer", video_reverse_size, 0, 0, (size_t)-1),
- OPT_BYTE_SIZE("audio-reversal-buffer", audio_reverse_size, 0, 0, (size_t)-1),
+ {"correct-pts", OPT_FLAG(correct_pts)},
+ {"fps", OPT_DOUBLE(force_fps), M_RANGE(0, DBL_MAX)},
+ {"ad", OPT_STRING_VALIDATE(audio_decoders, decoder_list_opt)},
+ {"vd", OPT_STRING_VALIDATE(video_decoders, decoder_list_opt)},
+ {"audio-spdif", OPT_STRING_VALIDATE(audio_spdif, decoder_list_opt)},
+ {"video-rotate", OPT_CHOICE(video_rotate, {"no", -1}),
+ .flags = UPDATE_IMGPAR, M_RANGE(0, 359)},
+ {"video-aspect-override", OPT_ASPECT(movie_aspect),
+ .flags = UPDATE_IMGPAR, M_RANGE(-1, 10)},
+ {"video-aspect-method", OPT_CHOICE(aspect_method,
+ {"bitstream", 1}, {"container", 2}),
+ .flags = UPDATE_IMGPAR},
+ {"vd-queue", OPT_SUBSTRUCT(vdec_queue_opts, vdec_queue_conf)},
+ {"ad-queue", OPT_SUBSTRUCT(adec_queue_opts, adec_queue_conf)},
+ {"video-reversal-buffer", OPT_BYTE_SIZE(video_reverse_size),
+ M_RANGE(0, (size_t)-1)},
+ {"audio-reversal-buffer", OPT_BYTE_SIZE(audio_reverse_size),
+ M_RANGE(0, (size_t)-1)},
{0}
},
.size = sizeof(struct dec_wrapper_opts),