summaryrefslogtreecommitdiffstats
path: root/filters/f_decoder_wrapper.c
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2023-02-20 04:32:50 +0100
committerDudemanguy <random342@airmail.cc>2023-02-21 17:15:17 +0000
commit91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29 (patch)
tree448b141d92c9ea7636954213b587aaf380fc21db /filters/f_decoder_wrapper.c
parentb9850a6e8c45f95563a703af7f21dfe1c1ee40b6 (diff)
downloadmpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.bz2
mpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.xz
options: transition options from OPT_FLAG to OPT_BOOL
c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
Diffstat (limited to 'filters/f_decoder_wrapper.c')
-rw-r--r--filters/f_decoder_wrapper.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c
index 4d0a8e7ac4..b0c174955b 100644
--- a/filters/f_decoder_wrapper.c
+++ b/filters/f_decoder_wrapper.c
@@ -53,7 +53,7 @@
#include "filter_internal.h"
struct dec_queue_opts {
- int use_queue;
+ bool use_queue;
int64_t max_bytes;
int64_t max_samples;
double max_duration;
@@ -62,7 +62,7 @@ struct dec_queue_opts {
#define OPT_BASE_STRUCT struct dec_queue_opts
static const struct m_option dec_queue_opts_list[] = {
- {"enable", OPT_FLAG(use_queue)},
+ {"enable", OPT_BOOL(use_queue)},
{"max-secs", OPT_DOUBLE(max_duration), M_RANGE(0, DBL_MAX)},
{"max-bytes", OPT_BYTE_SIZE(max_bytes), M_RANGE(0, M_MAX_MEM_BYTES)},
{"max-samples", OPT_INT64(max_samples), M_RANGE(0, DBL_MAX)},
@@ -73,7 +73,6 @@ static const struct m_sub_options vdec_queue_conf = {
.opts = dec_queue_opts_list,
.size = sizeof(struct dec_queue_opts),
.defaults = &(const struct dec_queue_opts){
- .use_queue = 0,
.max_bytes = 512 * 1024 * 1024,
.max_samples = 50,
.max_duration = 2,
@@ -84,7 +83,6 @@ static const struct m_sub_options adec_queue_conf = {
.opts = dec_queue_opts_list,
.size = sizeof(struct dec_queue_opts),
.defaults = &(const struct dec_queue_opts){
- .use_queue = 0,
.max_bytes = 1 * 1024 * 1024,
.max_samples = 48000,
.max_duration = 1,
@@ -98,7 +96,7 @@ struct dec_wrapper_opts {
float movie_aspect;
int aspect_method;
double force_fps;
- int correct_pts;
+ bool correct_pts;
int video_rotate;
char *audio_decoders;
char *video_decoders;
@@ -114,7 +112,7 @@ static int decoder_list_help(struct mp_log *log, const m_option_t *opt,
const struct m_sub_options dec_wrapper_conf = {
.opts = (const struct m_option[]){
- {"correct-pts", OPT_FLAG(correct_pts)},
+ {"correct-pts", OPT_BOOL(correct_pts)},
{"fps", OPT_DOUBLE(force_fps), M_RANGE(0, DBL_MAX)},
{"ad", OPT_STRING(audio_decoders),
.help = decoder_list_help},
@@ -139,7 +137,7 @@ const struct m_sub_options dec_wrapper_conf = {
},
.size = sizeof(struct dec_wrapper_opts),
.defaults = &(const struct dec_wrapper_opts){
- .correct_pts = 1,
+ .correct_pts = true,
.movie_aspect = -1.,
.aspect_method = 2,
.video_reverse_size = 1 * 1024 * 1024 * 1024,