summaryrefslogtreecommitdiffstats
path: root/filters
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
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')
-rw-r--r--filters/f_decoder_wrapper.c12
-rw-r--r--filters/f_lavfi.c4
-rw-r--r--filters/f_swresample.c4
-rw-r--r--filters/f_swresample.h4
-rw-r--r--filters/filter.c1
5 files changed, 11 insertions, 14 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,
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c
index 14ed2483a2..597cf91fc0 100644
--- a/filters/f_lavfi.c
+++ b/filters/f_lavfi.c
@@ -946,7 +946,7 @@ struct lavfi_user_opts {
char *filter_name;
char **filter_opts;
- int fix_pts;
+ bool fix_pts;
char *hwdec_interop;
};
@@ -1119,7 +1119,7 @@ const struct mp_user_filter_entry af_lavfi = {
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){
{"graph", OPT_STRING(graph)},
- {"fix-pts", OPT_FLAG(fix_pts)},
+ {"fix-pts", OPT_BOOL(fix_pts)},
{"o", OPT_KEYVALUELIST(avopts)},
{"hwdec_interop",
OPT_STRING_VALIDATE(hwdec_interop,
diff --git a/filters/f_swresample.c b/filters/f_swresample.c
index 60f9082ad3..fb1ef05194 100644
--- a/filters/f_swresample.c
+++ b/filters/f_swresample.c
@@ -71,9 +71,9 @@ const struct m_sub_options resample_conf = {
.opts = (const m_option_t[]) {
{"audio-resample-filter-size", OPT_INT(filter_size), M_RANGE(0, 32)},
{"audio-resample-phase-shift", OPT_INT(phase_shift), M_RANGE(0, 30)},
- {"audio-resample-linear", OPT_FLAG(linear)},
+ {"audio-resample-linear", OPT_BOOL(linear)},
{"audio-resample-cutoff", OPT_DOUBLE(cutoff), M_RANGE(0, 1)},
- {"audio-normalize-downmix", OPT_FLAG(normalize)},
+ {"audio-normalize-downmix", OPT_BOOL(normalize)},
{"audio-resample-max-output-size", OPT_DOUBLE(max_output_frame_size)},
{"audio-swresample-o", OPT_KEYVALUELIST(avopts)},
{0}
diff --git a/filters/f_swresample.h b/filters/f_swresample.h
index 10d6176a56..8ef33357e8 100644
--- a/filters/f_swresample.h
+++ b/filters/f_swresample.h
@@ -19,9 +19,9 @@ struct mp_swresample {
struct mp_resample_opts {
int filter_size;
int phase_shift;
- int linear;
+ bool linear;
double cutoff;
- int normalize;
+ bool normalize;
int allow_passthrough;
double max_output_frame_size;
char **avopts;
diff --git a/filters/filter.c b/filters/filter.c
index eb757f5753..e07caef131 100644
--- a/filters/filter.c
+++ b/filters/filter.c
@@ -693,7 +693,6 @@ struct mp_hwdec_ctx *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt
struct hwdec_imgfmt_request params = {
.imgfmt = imgfmt,
- .probing = false,
};
hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params);