diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2023-02-20 04:32:50 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-02-21 17:15:17 +0000 |
commit | 91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29 (patch) | |
tree | 448b141d92c9ea7636954213b587aaf380fc21db /demux | |
parent | b9850a6e8c45f95563a703af7f21dfe1c1ee40b6 (diff) | |
download | mpv-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 'demux')
-rw-r--r-- | demux/demux.c | 28 | ||||
-rw-r--r-- | demux/demux_lavf.c | 18 | ||||
-rw-r--r-- | demux/demux_libarchive.c | 4 | ||||
-rw-r--r-- | demux/demux_mkv.c | 6 |
4 files changed, 28 insertions, 28 deletions
diff --git a/demux/demux.c b/demux/demux.c index 79fa1aaebe..3d4c2fb692 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -86,24 +86,24 @@ static const demuxer_desc_t *const demuxer_list[] = { struct demux_opts { int enable_cache; - int disk_cache; + bool disk_cache; int64_t max_bytes; int64_t max_bytes_bw; - int donate_fw; + bool donate_fw; double min_secs; double hyst_secs; - int force_seekable; + bool force_seekable; double min_secs_cache; - int access_references; + bool access_references; int seekable_cache; - int create_ccs; + bool create_ccs; char *record_file; int video_back_preroll; int audio_back_preroll; int back_batch[STREAM_TYPE_COUNT]; double back_seek_size; char *meta_cp; - int force_retry_eof; + bool force_retry_eof; }; #define OPT_BASE_STRUCT struct demux_opts @@ -114,20 +114,20 @@ const struct m_sub_options demux_conf = { .opts = (const struct m_option[]){ {"cache", OPT_CHOICE(enable_cache, {"no", 0}, {"auto", -1}, {"yes", 1})}, - {"cache-on-disk", OPT_FLAG(disk_cache)}, + {"cache-on-disk", OPT_BOOL(disk_cache)}, {"demuxer-readahead-secs", OPT_DOUBLE(min_secs), M_RANGE(0, DBL_MAX)}, {"demuxer-hysteresis-secs", OPT_DOUBLE(hyst_secs), M_RANGE(0, DBL_MAX)}, {"demuxer-max-bytes", OPT_BYTE_SIZE(max_bytes), M_RANGE(0, M_MAX_MEM_BYTES)}, {"demuxer-max-back-bytes", OPT_BYTE_SIZE(max_bytes_bw), M_RANGE(0, M_MAX_MEM_BYTES)}, - {"demuxer-donate-buffer", OPT_FLAG(donate_fw)}, - {"force-seekable", OPT_FLAG(force_seekable)}, + {"demuxer-donate-buffer", OPT_BOOL(donate_fw)}, + {"force-seekable", OPT_BOOL(force_seekable)}, {"cache-secs", OPT_DOUBLE(min_secs_cache), M_RANGE(0, DBL_MAX)}, - {"access-references", OPT_FLAG(access_references)}, + {"access-references", OPT_BOOL(access_references)}, {"demuxer-seekable-cache", OPT_CHOICE(seekable_cache, {"auto", -1}, {"no", 0}, {"yes", 1})}, - {"sub-create-cc-track", OPT_FLAG(create_ccs)}, + {"sub-create-cc-track", OPT_BOOL(create_ccs)}, {"stream-record", OPT_STRING(record_file)}, {"video-backward-overlap", OPT_CHOICE(video_back_preroll, {"auto", -1}), M_RANGE(0, 1024)}, @@ -140,7 +140,7 @@ const struct m_sub_options demux_conf = { {"demuxer-backward-playback-step", OPT_DOUBLE(back_seek_size), M_RANGE(0, DBL_MAX)}, {"metadata-codepage", OPT_STRING(meta_cp)}, - {"demuxer-force-retry-on-eof", OPT_FLAG(force_retry_eof), + {"demuxer-force-retry-on-eof", OPT_BOOL(force_retry_eof), .deprecation_message = "temporary debug option, no replacement"}, {0} }, @@ -149,11 +149,11 @@ const struct m_sub_options demux_conf = { .enable_cache = -1, // auto .max_bytes = 150 * 1024 * 1024, .max_bytes_bw = 50 * 1024 * 1024, - .donate_fw = 1, + .donate_fw = true, .min_secs = 1.0, .min_secs_cache = 1000.0 * 60 * 60, .seekable_cache = -1, - .access_references = 1, + .access_references = true, .video_back_preroll = -1, .audio_back_preroll = -1, .back_seek_size = 60, diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index f4d3f96fdf..efe7f45ae9 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -76,14 +76,14 @@ struct demux_lavf_opts { int probescore; float analyzeduration; int buffersize; - int allow_mimetype; + bool allow_mimetype; char *format; char **avopts; - int hacks; + bool hacks; char *sub_cp; int rtsp_transport; int linearize_ts; - int propagate_opts; + bool propagate_opts; }; const struct m_sub_options demux_lavf_conf = { @@ -96,10 +96,10 @@ const struct m_sub_options demux_lavf_conf = { M_RANGE(0, 3600)}, {"demuxer-lavf-buffersize", OPT_INT(buffersize), M_RANGE(1, 10 * 1024 * 1024), OPTDEF_INT(BIO_BUFFER_SIZE)}, - {"demuxer-lavf-allow-mimetype", OPT_FLAG(allow_mimetype)}, + {"demuxer-lavf-allow-mimetype", OPT_BOOL(allow_mimetype)}, {"demuxer-lavf-probescore", OPT_INT(probescore), M_RANGE(1, AVPROBE_SCORE_MAX)}, - {"demuxer-lavf-hacks", OPT_FLAG(hacks)}, + {"demuxer-lavf-hacks", OPT_BOOL(hacks)}, {"demuxer-lavf-o", OPT_KEYVALUELIST(avopts)}, {"sub-codepage", OPT_STRING(sub_cp)}, {"rtsp-transport", OPT_CHOICE(rtsp_transport, @@ -110,14 +110,14 @@ const struct m_sub_options demux_lavf_conf = { {"udp_multicast", 4})}, {"demuxer-lavf-linearize-timestamps", OPT_CHOICE(linearize_ts, {"no", 0}, {"auto", -1}, {"yes", 1})}, - {"demuxer-lavf-propagate-opts", OPT_FLAG(propagate_opts)}, + {"demuxer-lavf-propagate-opts", OPT_BOOL(propagate_opts)}, {0} }, .size = sizeof(struct demux_lavf_opts), .defaults = &(const struct demux_lavf_opts){ .probeinfo = -1, - .allow_mimetype = 1, - .hacks = 1, + .allow_mimetype = true, + .hacks = true, // AVPROBE_SCORE_MAX/4 + 1 is the "recommended" limit. Below that, the // user is supposed to retry with larger probe sizes until a higher // value is reached. @@ -125,7 +125,7 @@ const struct m_sub_options demux_lavf_conf = { .sub_cp = "auto", .rtsp_transport = 2, .linearize_ts = -1, - .propagate_opts = 1, + .propagate_opts = true, }, }; diff --git a/demux/demux_libarchive.c b/demux/demux_libarchive.c index 9873232851..ec5049849d 100644 --- a/demux/demux_libarchive.c +++ b/demux/demux_libarchive.c @@ -28,7 +28,7 @@ #include "stream/stream_libarchive.h" struct demux_libarchive_opts { - int rar_list_all_volumes; + bool rar_list_all_volumes; }; static int cmp_filename(const void *a, const void *b) @@ -112,7 +112,7 @@ const struct demuxer_desc demuxer_desc_libarchive = { .open = open_file, .options = &(const struct m_sub_options){ .opts = (const struct m_option[]) { - {"rar-list-all-volumes", OPT_FLAG(rar_list_all_volumes)}, + {"rar-list-all-volumes", OPT_BOOL(rar_list_all_volumes)}, {0} }, .size = sizeof(OPT_BASE_STRUCT), diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index bd454cb143..3f0472dae9 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -224,7 +224,7 @@ struct demux_mkv_opts { double subtitle_preroll_secs; double subtitle_preroll_secs_index; int probe_duration; - int probe_start_time; + bool probe_start_time; }; const struct m_sub_options demux_mkv_conf = { @@ -237,7 +237,7 @@ const struct m_sub_options demux_mkv_conf = { M_RANGE(0, DBL_MAX)}, {"probe-video-duration", OPT_CHOICE(probe_duration, {"no", 0}, {"yes", 1}, {"full", 2})}, - {"probe-start-time", OPT_FLAG(probe_start_time)}, + {"probe-start-time", OPT_BOOL(probe_start_time)}, {0} }, .size = sizeof(struct demux_mkv_opts), @@ -245,7 +245,7 @@ const struct m_sub_options demux_mkv_conf = { .subtitle_preroll = 2, .subtitle_preroll_secs = 1.0, .subtitle_preroll_secs_index = 10.0, - .probe_start_time = 1, + .probe_start_time = true, }, }; |