options: transition options from OPT_FLAG to OPT_BOOL

c784820454 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.
This commit is contained in:
Christoph Heinrich 2023-02-20 04:32:50 +01:00 committed by Dudemanguy
parent b9850a6e8c
commit 91cc0d8cf6
80 changed files with 550 additions and 576 deletions

View File

@ -60,7 +60,7 @@ struct priv {
#define OPT_BASE_STRUCT struct ad_lavc_params #define OPT_BASE_STRUCT struct ad_lavc_params
struct ad_lavc_params { struct ad_lavc_params {
float ac3drc; float ac3drc;
int downmix; bool downmix;
int threads; int threads;
char **avopts; char **avopts;
}; };
@ -68,7 +68,7 @@ struct ad_lavc_params {
const struct m_sub_options ad_lavc_conf = { const struct m_sub_options ad_lavc_conf = {
.opts = (const m_option_t[]) { .opts = (const m_option_t[]) {
{"ac3drc", OPT_FLOAT(ac3drc), M_RANGE(0, 6)}, {"ac3drc", OPT_FLOAT(ac3drc), M_RANGE(0, 6)},
{"downmix", OPT_FLAG(downmix)}, {"downmix", OPT_BOOL(downmix)},
{"threads", OPT_INT(threads), M_RANGE(0, 16)}, {"threads", OPT_INT(threads), M_RANGE(0, 16)},
{"o", OPT_KEYVALUELIST(avopts)}, {"o", OPT_KEYVALUELIST(avopts)},
{0} {0}
@ -76,7 +76,6 @@ const struct m_sub_options ad_lavc_conf = {
.size = sizeof(struct ad_lavc_params), .size = sizeof(struct ad_lavc_params),
.defaults = &(const struct ad_lavc_params){ .defaults = &(const struct ad_lavc_params){
.ac3drc = 0, .ac3drc = 0,
.downmix = 0,
.threads = 1, .threads = 1,
}, },
}; };

View File

@ -30,7 +30,7 @@ struct f_opts {
int out_srate; int out_srate;
struct m_channels out_channels; struct m_channels out_channels;
int fail; bool fail;
}; };
struct priv { struct priv {
@ -135,7 +135,7 @@ const struct mp_user_filter_entry af_format = {
{"out-srate", OPT_INT(out_srate), M_RANGE(1000, 8*48000)}, {"out-srate", OPT_INT(out_srate), M_RANGE(1000, 8*48000)},
{"out-channels", OPT_CHANNELS(out_channels), {"out-channels", OPT_CHANNELS(out_channels),
.flags = M_OPT_CHANNELS_LIMITED}, .flags = M_OPT_CHANNELS_LIMITED},
{"fail", OPT_FLAG(fail)}, {"fail", OPT_BOOL(fail)},
{0} {0}
}, },
}, },

View File

@ -56,7 +56,7 @@ const static uint16_t ac3_bitrate_tab[19] = {
}; };
struct f_opts { struct f_opts {
int add_iec61937_header; bool add_iec61937_header;
int bit_rate; int bit_rate;
int min_channel_num; int min_channel_num;
char *encoder; char *encoder;
@ -418,13 +418,13 @@ const struct mp_user_filter_entry af_lavcac3enc = {
.name = "lavcac3enc", .name = "lavcac3enc",
.priv_size = sizeof(OPT_BASE_STRUCT), .priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT) { .priv_defaults = &(const OPT_BASE_STRUCT) {
.add_iec61937_header = 1, .add_iec61937_header = true,
.bit_rate = 640, .bit_rate = 640,
.min_channel_num = 3, .min_channel_num = 3,
.encoder = "ac3", .encoder = "ac3",
}, },
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"tospdif", OPT_FLAG(add_iec61937_header)}, {"tospdif", OPT_BOOL(add_iec61937_header)},
{"bitrate", OPT_CHOICE(bit_rate, {"bitrate", OPT_CHOICE(bit_rate,
{"auto", 0}, {"default", 0}), M_RANGE(32, 640)}, {"auto", 0}, {"default", 0}), M_RANGE(32, 640)},
{"minch", OPT_INT(min_channel_num), M_RANGE(2, 6)}, {"minch", OPT_INT(min_channel_num), M_RANGE(2, 6)},

View File

@ -56,9 +56,9 @@ struct ao_alsa_opts {
char *mixer_device; char *mixer_device;
char *mixer_name; char *mixer_name;
int mixer_index; int mixer_index;
int resample; bool resample;
int ni; bool ni;
int ignore_chmap; bool ignore_chmap;
int buffer_time; int buffer_time;
int frags; int frags;
}; };
@ -66,12 +66,12 @@ struct ao_alsa_opts {
#define OPT_BASE_STRUCT struct ao_alsa_opts #define OPT_BASE_STRUCT struct ao_alsa_opts
static const struct m_sub_options ao_alsa_conf = { static const struct m_sub_options ao_alsa_conf = {
.opts = (const struct m_option[]) { .opts = (const struct m_option[]) {
{"alsa-resample", OPT_FLAG(resample)}, {"alsa-resample", OPT_BOOL(resample)},
{"alsa-mixer-device", OPT_STRING(mixer_device)}, {"alsa-mixer-device", OPT_STRING(mixer_device)},
{"alsa-mixer-name", OPT_STRING(mixer_name)}, {"alsa-mixer-name", OPT_STRING(mixer_name)},
{"alsa-mixer-index", OPT_INT(mixer_index), M_RANGE(0, 99)}, {"alsa-mixer-index", OPT_INT(mixer_index), M_RANGE(0, 99)},
{"alsa-non-interleaved", OPT_FLAG(ni)}, {"alsa-non-interleaved", OPT_BOOL(ni)},
{"alsa-ignore-chmap", OPT_FLAG(ignore_chmap)}, {"alsa-ignore-chmap", OPT_BOOL(ignore_chmap)},
{"alsa-buffer-time", OPT_INT(buffer_time), M_RANGE(0, INT_MAX)}, {"alsa-buffer-time", OPT_INT(buffer_time), M_RANGE(0, INT_MAX)},
{"alsa-periods", OPT_INT(frags), M_RANGE(0, INT_MAX)}, {"alsa-periods", OPT_INT(frags), M_RANGE(0, INT_MAX)},
{0} {0}
@ -80,7 +80,6 @@ static const struct m_sub_options ao_alsa_conf = {
.mixer_device = "default", .mixer_device = "default",
.mixer_name = "Master", .mixer_name = "Master",
.mixer_index = 0, .mixer_index = 0,
.ni = 0,
.buffer_time = 100000, .buffer_time = 100000,
.frags = 4, .frags = 4,
}, },

View File

@ -54,7 +54,7 @@ struct priv {
jfloatArray floatarray; jfloatArray floatarray;
jobject bbuf; jobject bbuf;
int cfg_pcm_float; bool cfg_pcm_float;
int cfg_session_id; int cfg_session_id;
bool needs_timestamp_offset; bool needs_timestamp_offset;
@ -818,7 +818,7 @@ const struct ao_driver audio_out_audiotrack = {
.start = start, .start = start,
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"pcm-float", OPT_FLAG(cfg_pcm_float)}, {"pcm-float", OPT_BOOL(cfg_pcm_float)},
{"session-id", OPT_INT(cfg_session_id)}, {"session-id", OPT_INT(cfg_session_id)},
{0} {0}
}, },

View File

@ -36,7 +36,7 @@ struct priv {
AudioStreamBasicDescription original_asbd; AudioStreamBasicDescription original_asbd;
AudioStreamID original_asbd_stream; AudioStreamID original_asbd_stream;
int change_physical_format; bool change_physical_format;
}; };
static int64_t ca_get_hardware_latency(struct ao *ao) { static int64_t ca_get_hardware_latency(struct ao *ao) {
@ -421,7 +421,7 @@ const struct ao_driver audio_out_coreaudio = {
.list_devs = ca_get_device_list, .list_devs = ca_get_device_list,
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.options = (const struct m_option[]){ .options = (const struct m_option[]){
{"change-physical-format", OPT_FLAG(change_physical_format)}, {"change-physical-format", OPT_BOOL(change_physical_format)},
{0} {0}
}, },
.options_prefix = "coreaudio", .options_prefix = "coreaudio",

View File

@ -72,7 +72,7 @@ struct priv {
AudioStreamBasicDescription original_asbd; AudioStreamBasicDescription original_asbd;
// Output s16 physical format, float32 virtual format, ac3/dts mpv format // Output s16 physical format, float32 virtual format, ac3/dts mpv format
int spdif_hack; bool spdif_hack;
bool changed_mixing; bool changed_mixing;
@ -461,10 +461,9 @@ const struct ao_driver audio_out_coreaudio_exclusive = {
.hog_pid = -1, .hog_pid = -1,
.stream = 0, .stream = 0,
.stream_idx = -1, .stream_idx = -1,
.changed_mixing = false,
}, },
.options = (const struct m_option[]){ .options = (const struct m_option[]){
{"spdif-hack", OPT_FLAG(spdif_hack)}, {"spdif-hack", OPT_BOOL(spdif_hack)},
{0} {0}
}, },
.options_prefix = "coreaudio", .options_prefix = "coreaudio",

View File

@ -47,8 +47,8 @@
struct jack_opts { struct jack_opts {
char *port; char *port;
char *client_name; char *client_name;
int connect; bool connect;
int autostart; bool autostart;
int stdlayout; int stdlayout;
}; };
@ -57,15 +57,15 @@ static const struct m_sub_options ao_jack_conf = {
.opts = (const struct m_option[]){ .opts = (const struct m_option[]){
{"jack-port", OPT_STRING(port)}, {"jack-port", OPT_STRING(port)},
{"jack-name", OPT_STRING(client_name)}, {"jack-name", OPT_STRING(client_name)},
{"jack-autostart", OPT_FLAG(autostart)}, {"jack-autostart", OPT_BOOL(autostart)},
{"jack-connect", OPT_FLAG(connect)}, {"jack-connect", OPT_BOOL(connect)},
{"jack-std-channel-layout", OPT_CHOICE(stdlayout, {"jack-std-channel-layout", OPT_CHOICE(stdlayout,
{"waveext", 0}, {"any", 1})}, {"waveext", 0}, {"any", 1})},
{0} {0}
}, },
.defaults = &(const struct jack_opts) { .defaults = &(const struct jack_opts) {
.client_name = "mpv", .client_name = "mpv",
.connect = 1, .connect = true,
}, },
.size = sizeof(struct jack_opts), .size = sizeof(struct jack_opts),
}; };

View File

@ -43,13 +43,13 @@ struct priv {
int buffersize; // samples int buffersize; // samples
bool playing; bool playing;
int untimed; bool untimed;
float bufferlen; // seconds float bufferlen; // seconds
float speed; // multiplier float speed; // multiplier
float latency_sec; // seconds float latency_sec; // seconds
float latency; // samples float latency; // samples
int broken_eof; bool broken_eof;
int broken_delay; bool broken_delay;
// Minimal unit of audio samples that can be written at once. If play() is // Minimal unit of audio samples that can be written at once. If play() is
// called with sizes not aligned to this, a rounded size will be returned. // called with sizes not aligned to this, a rounded size will be returned.
@ -215,13 +215,13 @@ const struct ao_driver audio_out_null = {
.speed = 1, .speed = 1,
}, },
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"untimed", OPT_FLAG(untimed)}, {"untimed", OPT_BOOL(untimed)},
{"buffer", OPT_FLOAT(bufferlen), M_RANGE(0, 100)}, {"buffer", OPT_FLOAT(bufferlen), M_RANGE(0, 100)},
{"outburst", OPT_INT(outburst), M_RANGE(1, 100000)}, {"outburst", OPT_INT(outburst), M_RANGE(1, 100000)},
{"speed", OPT_FLOAT(speed), M_RANGE(0, 10000)}, {"speed", OPT_FLOAT(speed), M_RANGE(0, 10000)},
{"latency", OPT_FLOAT(latency_sec), M_RANGE(0, 100)}, {"latency", OPT_FLOAT(latency_sec), M_RANGE(0, 100)},
{"broken-eof", OPT_FLAG(broken_eof)}, {"broken-eof", OPT_BOOL(broken_eof)},
{"broken-delay", OPT_FLAG(broken_delay)}, {"broken-delay", OPT_BOOL(broken_delay)},
{"channel-layouts", OPT_CHANNELS(channel_layouts)}, {"channel-layouts", OPT_CHANNELS(channel_layouts)},
{"format", OPT_AUDIOFORMAT(format)}, {"format", OPT_AUDIOFORMAT(format)},
{0} {0}

View File

@ -56,7 +56,7 @@ struct priv {
ALenum al_format; ALenum al_format;
int num_buffers; int num_buffers;
int num_samples; int num_samples;
int direct_channels; bool direct_channels;
}; };
static int control(struct ao *ao, enum aocontrol cmd, void *arg) static int control(struct ao *ao, enum aocontrol cmd, void *arg)
@ -389,12 +389,12 @@ const struct ao_driver audio_out_openal = {
.priv_defaults = &(const struct priv) { .priv_defaults = &(const struct priv) {
.num_buffers = 4, .num_buffers = 4,
.num_samples = 8192, .num_samples = 8192,
.direct_channels = 1, .direct_channels = true,
}, },
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"num-buffers", OPT_INT(num_buffers), M_RANGE(2, MAX_BUF)}, {"num-buffers", OPT_INT(num_buffers), M_RANGE(2, MAX_BUF)},
{"num-samples", OPT_INT(num_samples), M_RANGE(256, MAX_SAMPLES)}, {"num-samples", OPT_INT(num_samples), M_RANGE(256, MAX_SAMPLES)},
{"direct-channels", OPT_FLAG(direct_channels)}, {"direct-channels", OPT_BOOL(direct_channels)},
{0} {0}
}, },
.options_prefix = "openal", .options_prefix = "openal",

View File

@ -404,6 +404,5 @@ const struct ao_driver audio_out_oss = {
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.priv_defaults = &(const struct priv) { .priv_defaults = &(const struct priv) {
.dsp_fd = -1, .dsp_fd = -1,
.playing = false,
}, },
}; };

View File

@ -42,8 +42,8 @@
struct priv { struct priv {
char *outputfilename; char *outputfilename;
int waveheader; bool waveheader;
int append; bool append;
uint64_t data_length; uint64_t data_length;
FILE *fp; FILE *fp;
}; };
@ -237,11 +237,11 @@ const struct ao_driver audio_out_pcm = {
.start = start, .start = start,
.reset = reset, .reset = reset,
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.priv_defaults = &(const struct priv) { .waveheader = 1 }, .priv_defaults = &(const struct priv) { .waveheader = true },
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"file", OPT_STRING(outputfilename), .flags = M_OPT_FILE}, {"file", OPT_STRING(outputfilename), .flags = M_OPT_FILE},
{"waveheader", OPT_FLAG(waveheader)}, {"waveheader", OPT_BOOL(waveheader)},
{"append", OPT_FLAG(append)}, {"append", OPT_BOOL(append)},
{0} {0}
}, },
.options_prefix = "ao-pcm", .options_prefix = "ao-pcm",

View File

@ -56,8 +56,8 @@ struct priv {
char *cfg_host; char *cfg_host;
int cfg_buffer; int cfg_buffer;
int cfg_latency_hacks; bool cfg_latency_hacks;
int cfg_allow_suspended; bool cfg_allow_suspended;
}; };
#define GENERIC_ERR_MSG(str) \ #define GENERIC_ERR_MSG(str) \
@ -810,8 +810,8 @@ const struct ao_driver audio_out_pulse = {
{"host", OPT_STRING(cfg_host)}, {"host", OPT_STRING(cfg_host)},
{"buffer", OPT_CHOICE(cfg_buffer, {"native", 0}), {"buffer", OPT_CHOICE(cfg_buffer, {"native", 0}),
M_RANGE(1, 2000)}, M_RANGE(1, 2000)},
{"latency-hacks", OPT_FLAG(cfg_latency_hacks)}, {"latency-hacks", OPT_BOOL(cfg_latency_hacks)},
{"allow-suspended", OPT_FLAG(cfg_allow_suspended)}, {"allow-suspended", OPT_BOOL(cfg_allow_suspended)},
{0} {0}
}, },
.options_prefix = "pulse", .options_prefix = "pulse",

View File

@ -40,10 +40,10 @@ struct encode_opts {
char **aopts; char **aopts;
float voffset; float voffset;
float aoffset; float aoffset;
int rawts; bool rawts;
int video_first; bool video_first;
int audio_first; bool audio_first;
int copy_metadata; bool copy_metadata;
char **set_metadata; char **set_metadata;
char **remove_metadata; char **remove_metadata;
}; };

View File

@ -87,12 +87,12 @@ const struct m_sub_options encode_config = {
.deprecation_message = "--audio-delay (once unbroken)"}, .deprecation_message = "--audio-delay (once unbroken)"},
{"oaoffset", OPT_FLOAT(aoffset), M_RANGE(-1000000.0, 1000000.0), {"oaoffset", OPT_FLOAT(aoffset), M_RANGE(-1000000.0, 1000000.0),
.deprecation_message = "--audio-delay (once unbroken)"}, .deprecation_message = "--audio-delay (once unbroken)"},
{"orawts", OPT_FLAG(rawts)}, {"orawts", OPT_BOOL(rawts)},
{"ovfirst", OPT_FLAG(video_first), {"ovfirst", OPT_BOOL(video_first),
.deprecation_message = "no replacement"}, .deprecation_message = "no replacement"},
{"oafirst", OPT_FLAG(audio_first), {"oafirst", OPT_BOOL(audio_first),
.deprecation_message = "no replacement"}, .deprecation_message = "no replacement"},
{"ocopy-metadata", OPT_FLAG(copy_metadata)}, {"ocopy-metadata", OPT_BOOL(copy_metadata)},
{"oset-metadata", OPT_KEYVALUELIST(set_metadata)}, {"oset-metadata", OPT_KEYVALUELIST(set_metadata)},
{"oremove-metadata", OPT_STRINGLIST(remove_metadata)}, {"oremove-metadata", OPT_STRINGLIST(remove_metadata)},
@ -106,7 +106,7 @@ const struct m_sub_options encode_config = {
}, },
.size = sizeof(struct encode_opts), .size = sizeof(struct encode_opts),
.defaults = &(const struct encode_opts){ .defaults = &(const struct encode_opts){
.copy_metadata = 1, .copy_metadata = true,
}, },
}; };

View File

@ -86,24 +86,24 @@ static const demuxer_desc_t *const demuxer_list[] = {
struct demux_opts { struct demux_opts {
int enable_cache; int enable_cache;
int disk_cache; bool disk_cache;
int64_t max_bytes; int64_t max_bytes;
int64_t max_bytes_bw; int64_t max_bytes_bw;
int donate_fw; bool donate_fw;
double min_secs; double min_secs;
double hyst_secs; double hyst_secs;
int force_seekable; bool force_seekable;
double min_secs_cache; double min_secs_cache;
int access_references; bool access_references;
int seekable_cache; int seekable_cache;
int create_ccs; bool create_ccs;
char *record_file; char *record_file;
int video_back_preroll; int video_back_preroll;
int audio_back_preroll; int audio_back_preroll;
int back_batch[STREAM_TYPE_COUNT]; int back_batch[STREAM_TYPE_COUNT];
double back_seek_size; double back_seek_size;
char *meta_cp; char *meta_cp;
int force_retry_eof; bool force_retry_eof;
}; };
#define OPT_BASE_STRUCT struct demux_opts #define OPT_BASE_STRUCT struct demux_opts
@ -114,20 +114,20 @@ const struct m_sub_options demux_conf = {
.opts = (const struct m_option[]){ .opts = (const struct m_option[]){
{"cache", OPT_CHOICE(enable_cache, {"cache", OPT_CHOICE(enable_cache,
{"no", 0}, {"auto", -1}, {"yes", 1})}, {"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-readahead-secs", OPT_DOUBLE(min_secs), M_RANGE(0, DBL_MAX)},
{"demuxer-hysteresis-secs", OPT_DOUBLE(hyst_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), {"demuxer-max-bytes", OPT_BYTE_SIZE(max_bytes),
M_RANGE(0, M_MAX_MEM_BYTES)}, M_RANGE(0, M_MAX_MEM_BYTES)},
{"demuxer-max-back-bytes", OPT_BYTE_SIZE(max_bytes_bw), {"demuxer-max-back-bytes", OPT_BYTE_SIZE(max_bytes_bw),
M_RANGE(0, M_MAX_MEM_BYTES)}, M_RANGE(0, M_MAX_MEM_BYTES)},
{"demuxer-donate-buffer", OPT_FLAG(donate_fw)}, {"demuxer-donate-buffer", OPT_BOOL(donate_fw)},
{"force-seekable", OPT_FLAG(force_seekable)}, {"force-seekable", OPT_BOOL(force_seekable)},
{"cache-secs", OPT_DOUBLE(min_secs_cache), M_RANGE(0, DBL_MAX)}, {"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, {"demuxer-seekable-cache", OPT_CHOICE(seekable_cache,
{"auto", -1}, {"no", 0}, {"yes", 1})}, {"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)}, {"stream-record", OPT_STRING(record_file)},
{"video-backward-overlap", OPT_CHOICE(video_back_preroll, {"auto", -1}), {"video-backward-overlap", OPT_CHOICE(video_back_preroll, {"auto", -1}),
M_RANGE(0, 1024)}, M_RANGE(0, 1024)},
@ -140,7 +140,7 @@ const struct m_sub_options demux_conf = {
{"demuxer-backward-playback-step", OPT_DOUBLE(back_seek_size), {"demuxer-backward-playback-step", OPT_DOUBLE(back_seek_size),
M_RANGE(0, DBL_MAX)}, M_RANGE(0, DBL_MAX)},
{"metadata-codepage", OPT_STRING(meta_cp)}, {"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"}, .deprecation_message = "temporary debug option, no replacement"},
{0} {0}
}, },
@ -149,11 +149,11 @@ const struct m_sub_options demux_conf = {
.enable_cache = -1, // auto .enable_cache = -1, // auto
.max_bytes = 150 * 1024 * 1024, .max_bytes = 150 * 1024 * 1024,
.max_bytes_bw = 50 * 1024 * 1024, .max_bytes_bw = 50 * 1024 * 1024,
.donate_fw = 1, .donate_fw = true,
.min_secs = 1.0, .min_secs = 1.0,
.min_secs_cache = 1000.0 * 60 * 60, .min_secs_cache = 1000.0 * 60 * 60,
.seekable_cache = -1, .seekable_cache = -1,
.access_references = 1, .access_references = true,
.video_back_preroll = -1, .video_back_preroll = -1,
.audio_back_preroll = -1, .audio_back_preroll = -1,
.back_seek_size = 60, .back_seek_size = 60,

View File

@ -76,14 +76,14 @@ struct demux_lavf_opts {
int probescore; int probescore;
float analyzeduration; float analyzeduration;
int buffersize; int buffersize;
int allow_mimetype; bool allow_mimetype;
char *format; char *format;
char **avopts; char **avopts;
int hacks; bool hacks;
char *sub_cp; char *sub_cp;
int rtsp_transport; int rtsp_transport;
int linearize_ts; int linearize_ts;
int propagate_opts; bool propagate_opts;
}; };
const struct m_sub_options demux_lavf_conf = { const struct m_sub_options demux_lavf_conf = {
@ -96,10 +96,10 @@ const struct m_sub_options demux_lavf_conf = {
M_RANGE(0, 3600)}, M_RANGE(0, 3600)},
{"demuxer-lavf-buffersize", OPT_INT(buffersize), {"demuxer-lavf-buffersize", OPT_INT(buffersize),
M_RANGE(1, 10 * 1024 * 1024), OPTDEF_INT(BIO_BUFFER_SIZE)}, 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), {"demuxer-lavf-probescore", OPT_INT(probescore),
M_RANGE(1, AVPROBE_SCORE_MAX)}, M_RANGE(1, AVPROBE_SCORE_MAX)},
{"demuxer-lavf-hacks", OPT_FLAG(hacks)}, {"demuxer-lavf-hacks", OPT_BOOL(hacks)},
{"demuxer-lavf-o", OPT_KEYVALUELIST(avopts)}, {"demuxer-lavf-o", OPT_KEYVALUELIST(avopts)},
{"sub-codepage", OPT_STRING(sub_cp)}, {"sub-codepage", OPT_STRING(sub_cp)},
{"rtsp-transport", OPT_CHOICE(rtsp_transport, {"rtsp-transport", OPT_CHOICE(rtsp_transport,
@ -110,14 +110,14 @@ const struct m_sub_options demux_lavf_conf = {
{"udp_multicast", 4})}, {"udp_multicast", 4})},
{"demuxer-lavf-linearize-timestamps", OPT_CHOICE(linearize_ts, {"demuxer-lavf-linearize-timestamps", OPT_CHOICE(linearize_ts,
{"no", 0}, {"auto", -1}, {"yes", 1})}, {"no", 0}, {"auto", -1}, {"yes", 1})},
{"demuxer-lavf-propagate-opts", OPT_FLAG(propagate_opts)}, {"demuxer-lavf-propagate-opts", OPT_BOOL(propagate_opts)},
{0} {0}
}, },
.size = sizeof(struct demux_lavf_opts), .size = sizeof(struct demux_lavf_opts),
.defaults = &(const struct demux_lavf_opts){ .defaults = &(const struct demux_lavf_opts){
.probeinfo = -1, .probeinfo = -1,
.allow_mimetype = 1, .allow_mimetype = true,
.hacks = 1, .hacks = true,
// AVPROBE_SCORE_MAX/4 + 1 is the "recommended" limit. Below that, the // AVPROBE_SCORE_MAX/4 + 1 is the "recommended" limit. Below that, the
// user is supposed to retry with larger probe sizes until a higher // user is supposed to retry with larger probe sizes until a higher
// value is reached. // value is reached.
@ -125,7 +125,7 @@ const struct m_sub_options demux_lavf_conf = {
.sub_cp = "auto", .sub_cp = "auto",
.rtsp_transport = 2, .rtsp_transport = 2,
.linearize_ts = -1, .linearize_ts = -1,
.propagate_opts = 1, .propagate_opts = true,
}, },
}; };

View File

@ -28,7 +28,7 @@
#include "stream/stream_libarchive.h" #include "stream/stream_libarchive.h"
struct demux_libarchive_opts { struct demux_libarchive_opts {
int rar_list_all_volumes; bool rar_list_all_volumes;
}; };
static int cmp_filename(const void *a, const void *b) static int cmp_filename(const void *a, const void *b)
@ -112,7 +112,7 @@ const struct demuxer_desc demuxer_desc_libarchive = {
.open = open_file, .open = open_file,
.options = &(const struct m_sub_options){ .options = &(const struct m_sub_options){
.opts = (const struct m_option[]) { .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} {0}
}, },
.size = sizeof(OPT_BASE_STRUCT), .size = sizeof(OPT_BASE_STRUCT),

View File

@ -224,7 +224,7 @@ struct demux_mkv_opts {
double subtitle_preroll_secs; double subtitle_preroll_secs;
double subtitle_preroll_secs_index; double subtitle_preroll_secs_index;
int probe_duration; int probe_duration;
int probe_start_time; bool probe_start_time;
}; };
const struct m_sub_options demux_mkv_conf = { 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)}, M_RANGE(0, DBL_MAX)},
{"probe-video-duration", OPT_CHOICE(probe_duration, {"probe-video-duration", OPT_CHOICE(probe_duration,
{"no", 0}, {"yes", 1}, {"full", 2})}, {"no", 0}, {"yes", 1}, {"full", 2})},
{"probe-start-time", OPT_FLAG(probe_start_time)}, {"probe-start-time", OPT_BOOL(probe_start_time)},
{0} {0}
}, },
.size = sizeof(struct demux_mkv_opts), .size = sizeof(struct demux_mkv_opts),
@ -245,7 +245,7 @@ const struct m_sub_options demux_mkv_conf = {
.subtitle_preroll = 2, .subtitle_preroll = 2,
.subtitle_preroll_secs = 1.0, .subtitle_preroll_secs = 1.0,
.subtitle_preroll_secs_index = 10.0, .subtitle_preroll_secs_index = 10.0,
.probe_start_time = 1, .probe_start_time = true,
}, },
}; };

View File

@ -53,7 +53,7 @@
#include "filter_internal.h" #include "filter_internal.h"
struct dec_queue_opts { struct dec_queue_opts {
int use_queue; bool use_queue;
int64_t max_bytes; int64_t max_bytes;
int64_t max_samples; int64_t max_samples;
double max_duration; double max_duration;
@ -62,7 +62,7 @@ struct dec_queue_opts {
#define OPT_BASE_STRUCT struct dec_queue_opts #define OPT_BASE_STRUCT struct dec_queue_opts
static const struct m_option dec_queue_opts_list[] = { 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-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-bytes", OPT_BYTE_SIZE(max_bytes), M_RANGE(0, M_MAX_MEM_BYTES)},
{"max-samples", OPT_INT64(max_samples), M_RANGE(0, DBL_MAX)}, {"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, .opts = dec_queue_opts_list,
.size = sizeof(struct dec_queue_opts), .size = sizeof(struct dec_queue_opts),
.defaults = &(const struct dec_queue_opts){ .defaults = &(const struct dec_queue_opts){
.use_queue = 0,
.max_bytes = 512 * 1024 * 1024, .max_bytes = 512 * 1024 * 1024,
.max_samples = 50, .max_samples = 50,
.max_duration = 2, .max_duration = 2,
@ -84,7 +83,6 @@ static const struct m_sub_options adec_queue_conf = {
.opts = dec_queue_opts_list, .opts = dec_queue_opts_list,
.size = sizeof(struct dec_queue_opts), .size = sizeof(struct dec_queue_opts),
.defaults = &(const struct dec_queue_opts){ .defaults = &(const struct dec_queue_opts){
.use_queue = 0,
.max_bytes = 1 * 1024 * 1024, .max_bytes = 1 * 1024 * 1024,
.max_samples = 48000, .max_samples = 48000,
.max_duration = 1, .max_duration = 1,
@ -98,7 +96,7 @@ struct dec_wrapper_opts {
float movie_aspect; float movie_aspect;
int aspect_method; int aspect_method;
double force_fps; double force_fps;
int correct_pts; bool correct_pts;
int video_rotate; int video_rotate;
char *audio_decoders; char *audio_decoders;
char *video_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 = { const struct m_sub_options dec_wrapper_conf = {
.opts = (const struct m_option[]){ .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)}, {"fps", OPT_DOUBLE(force_fps), M_RANGE(0, DBL_MAX)},
{"ad", OPT_STRING(audio_decoders), {"ad", OPT_STRING(audio_decoders),
.help = decoder_list_help}, .help = decoder_list_help},
@ -139,7 +137,7 @@ const struct m_sub_options dec_wrapper_conf = {
}, },
.size = sizeof(struct dec_wrapper_opts), .size = sizeof(struct dec_wrapper_opts),
.defaults = &(const struct dec_wrapper_opts){ .defaults = &(const struct dec_wrapper_opts){
.correct_pts = 1, .correct_pts = true,
.movie_aspect = -1., .movie_aspect = -1.,
.aspect_method = 2, .aspect_method = 2,
.video_reverse_size = 1 * 1024 * 1024 * 1024, .video_reverse_size = 1 * 1024 * 1024 * 1024,

View File

@ -946,7 +946,7 @@ struct lavfi_user_opts {
char *filter_name; char *filter_name;
char **filter_opts; char **filter_opts;
int fix_pts; bool fix_pts;
char *hwdec_interop; char *hwdec_interop;
}; };
@ -1119,7 +1119,7 @@ const struct mp_user_filter_entry af_lavfi = {
.priv_size = sizeof(OPT_BASE_STRUCT), .priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){ .options = (const m_option_t[]){
{"graph", OPT_STRING(graph)}, {"graph", OPT_STRING(graph)},
{"fix-pts", OPT_FLAG(fix_pts)}, {"fix-pts", OPT_BOOL(fix_pts)},
{"o", OPT_KEYVALUELIST(avopts)}, {"o", OPT_KEYVALUELIST(avopts)},
{"hwdec_interop", {"hwdec_interop",
OPT_STRING_VALIDATE(hwdec_interop, OPT_STRING_VALIDATE(hwdec_interop,

View File

@ -71,9 +71,9 @@ const struct m_sub_options resample_conf = {
.opts = (const m_option_t[]) { .opts = (const m_option_t[]) {
{"audio-resample-filter-size", OPT_INT(filter_size), M_RANGE(0, 32)}, {"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-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-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-resample-max-output-size", OPT_DOUBLE(max_output_frame_size)},
{"audio-swresample-o", OPT_KEYVALUELIST(avopts)}, {"audio-swresample-o", OPT_KEYVALUELIST(avopts)},
{0} {0}

View File

@ -19,9 +19,9 @@ struct mp_swresample {
struct mp_resample_opts { struct mp_resample_opts {
int filter_size; int filter_size;
int phase_shift; int phase_shift;
int linear; bool linear;
double cutoff; double cutoff;
int normalize; bool normalize;
int allow_passthrough; int allow_passthrough;
double max_output_frame_size; double max_output_frame_size;
char **avopts; char **avopts;

View File

@ -693,7 +693,6 @@ struct mp_hwdec_ctx *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt
struct hwdec_imgfmt_request params = { struct hwdec_imgfmt_request params = {
.imgfmt = imgfmt, .imgfmt = imgfmt,
.probing = false,
}; };
hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params); hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params);

View File

@ -171,15 +171,15 @@ struct input_opts {
// Autorepeat config (be aware of mp_input_set_repeat_info()) // Autorepeat config (be aware of mp_input_set_repeat_info())
int ar_delay; int ar_delay;
int ar_rate; int ar_rate;
int use_alt_gr; bool use_alt_gr;
int use_gamepad; bool use_gamepad;
int use_media_keys; bool use_media_keys;
int default_bindings; bool default_bindings;
int builtin_bindings; bool builtin_bindings;
int enable_mouse_movements; bool enable_mouse_movements;
int vo_key_input; bool vo_key_input;
int test; bool test;
int allow_win_drag; bool allow_win_drag;
}; };
const struct m_sub_options input_config = { const struct m_sub_options input_config = {
@ -189,20 +189,20 @@ const struct m_sub_options input_config = {
{"input-ar-rate", OPT_INT(ar_rate)}, {"input-ar-rate", OPT_INT(ar_rate)},
{"input-keylist", OPT_PRINT(mp_print_key_list)}, {"input-keylist", OPT_PRINT(mp_print_key_list)},
{"input-cmdlist", OPT_PRINT(mp_print_cmd_list)}, {"input-cmdlist", OPT_PRINT(mp_print_cmd_list)},
{"input-default-bindings", OPT_FLAG(default_bindings)}, {"input-default-bindings", OPT_BOOL(default_bindings)},
{"input-builtin-bindings", OPT_FLAG(builtin_bindings)}, {"input-builtin-bindings", OPT_BOOL(builtin_bindings)},
{"input-test", OPT_FLAG(test)}, {"input-test", OPT_BOOL(test)},
{"input-doubleclick-time", OPT_INT(doubleclick_time), {"input-doubleclick-time", OPT_INT(doubleclick_time),
M_RANGE(0, 1000)}, M_RANGE(0, 1000)},
{"input-right-alt-gr", OPT_FLAG(use_alt_gr)}, {"input-right-alt-gr", OPT_BOOL(use_alt_gr)},
{"input-key-fifo-size", OPT_INT(key_fifo_size), M_RANGE(2, 65000)}, {"input-key-fifo-size", OPT_INT(key_fifo_size), M_RANGE(2, 65000)},
{"input-cursor", OPT_FLAG(enable_mouse_movements)}, {"input-cursor", OPT_BOOL(enable_mouse_movements)},
{"input-vo-keyboard", OPT_FLAG(vo_key_input)}, {"input-vo-keyboard", OPT_BOOL(vo_key_input)},
{"input-media-keys", OPT_FLAG(use_media_keys)}, {"input-media-keys", OPT_BOOL(use_media_keys)},
#if HAVE_SDL2_GAMEPAD #if HAVE_SDL2_GAMEPAD
{"input-gamepad", OPT_FLAG(use_gamepad)}, {"input-gamepad", OPT_BOOL(use_gamepad)},
#endif #endif
{"window-dragging", OPT_FLAG(allow_win_drag)}, {"window-dragging", OPT_BOOL(allow_win_drag)},
{"input-x11-keyboard", OPT_REPLACED("input-vo-keyboard")}, {"input-x11-keyboard", OPT_REPLACED("input-vo-keyboard")},
#if HAVE_COCOA #if HAVE_COCOA
{"input-appleremote", OPT_REMOVED("replaced by MediaPlayer support")}, {"input-appleremote", OPT_REMOVED("replaced by MediaPlayer support")},
@ -215,13 +215,13 @@ const struct m_sub_options input_config = {
.doubleclick_time = 300, .doubleclick_time = 300,
.ar_delay = 200, .ar_delay = 200,
.ar_rate = 40, .ar_rate = 40,
.use_alt_gr = 1, .use_alt_gr = true,
.enable_mouse_movements = 1, .enable_mouse_movements = true,
.use_media_keys = 1, .use_media_keys = true,
.default_bindings = 1, .default_bindings = true,
.builtin_bindings = 1, .builtin_bindings = true,
.vo_key_input = 1, .vo_key_input = true,
.allow_win_drag = 1, .allow_win_drag = true,
}, },
.change_flags = UPDATE_INPUT, .change_flags = UPDATE_INPUT,
}; };
@ -1474,7 +1474,6 @@ void mp_input_bind_key(struct input_ctx *ictx, int key, bstr command)
.cmd = bstrdup0(bs->binds, command), .cmd = bstrdup0(bs->binds, command),
.location = talloc_strdup(bs->binds, "keybind-command"), .location = talloc_strdup(bs->binds, "keybind-command"),
.owner = bs, .owner = bs,
.is_builtin = false,
.num_keys = 1, .num_keys = 1,
}; };
memcpy(bind->keys, &key, 1 * sizeof(bind->keys[0])); memcpy(bind->keys, &key, 1 * sizeof(bind->keys[0]));
@ -1698,4 +1697,3 @@ void mp_input_set_repeat_info(struct input_ctx *ictx, int rate, int delay)
ictx->opts->ar_delay = delay; ictx->opts->ar_delay = delay;
input_unlock(ictx); input_unlock(ictx);
} }

View File

@ -105,25 +105,25 @@ static const struct m_sub_options screenshot_conf = {
static const m_option_t mp_vo_opt_list[] = { static const m_option_t mp_vo_opt_list[] = {
{"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)}, {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)},
{"taskbar-progress", OPT_FLAG(taskbar_progress)}, {"taskbar-progress", OPT_BOOL(taskbar_progress)},
{"snap-window", OPT_FLAG(snap_window)}, {"snap-window", OPT_BOOL(snap_window)},
{"ontop", OPT_FLAG(ontop)}, {"ontop", OPT_BOOL(ontop)},
{"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2}, {"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2},
{"desktop", -3}), M_RANGE(0, INT_MAX)}, {"desktop", -3}), M_RANGE(0, INT_MAX)},
{"border", OPT_FLAG(border)}, {"border", OPT_BOOL(border)},
{"fit-border", OPT_FLAG(fit_border), {"fit-border", OPT_BOOL(fit_border),
.deprecation_message = "the option is ignored and no longer needed"}, .deprecation_message = "the option is ignored and no longer needed"},
{"on-all-workspaces", OPT_FLAG(all_workspaces)}, {"on-all-workspaces", OPT_BOOL(all_workspaces)},
{"geometry", OPT_GEOMETRY(geometry)}, {"geometry", OPT_GEOMETRY(geometry)},
{"autofit", OPT_SIZE_BOX(autofit)}, {"autofit", OPT_SIZE_BOX(autofit)},
{"autofit-larger", OPT_SIZE_BOX(autofit_larger)}, {"autofit-larger", OPT_SIZE_BOX(autofit_larger)},
{"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)}, {"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)},
{"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)}, {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)},
{"window-minimized", OPT_FLAG(window_minimized)}, {"window-minimized", OPT_BOOL(window_minimized)},
{"window-maximized", OPT_FLAG(window_maximized)}, {"window-maximized", OPT_BOOL(window_maximized)},
{"focus-on-open", OPT_BOOL(focus_on_open)}, {"focus-on-open", OPT_BOOL(focus_on_open)},
{"force-render", OPT_FLAG(force_render)}, {"force-render", OPT_BOOL(force_render)},
{"force-window-position", OPT_FLAG(force_window_position)}, {"force-window-position", OPT_BOOL(force_window_position)},
{"x11-name", OPT_STRING(winname)}, {"x11-name", OPT_STRING(winname)},
{"wayland-app-id", OPT_STRING(appid)}, {"wayland-app-id", OPT_STRING(appid)},
{"monitoraspect", OPT_FLOAT(force_monitor_aspect), M_RANGE(0.0, 9.0)}, {"monitoraspect", OPT_FLOAT(force_monitor_aspect), M_RANGE(0.0, 9.0)},
@ -131,7 +131,7 @@ static const m_option_t mp_vo_opt_list[] = {
M_RANGE(1.0/32.0, 32.0)}, M_RANGE(1.0/32.0, 32.0)},
{"fullscreen", OPT_BOOL(fullscreen)}, {"fullscreen", OPT_BOOL(fullscreen)},
{"fs", OPT_ALIAS("fullscreen")}, {"fs", OPT_ALIAS("fullscreen")},
{"native-keyrepeat", OPT_FLAG(native_keyrepeat)}, {"native-keyrepeat", OPT_BOOL(native_keyrepeat)},
{"panscan", OPT_FLOAT(panscan), M_RANGE(0.0, 1.0)}, {"panscan", OPT_FLOAT(panscan), M_RANGE(0.0, 1.0)},
{"video-zoom", OPT_FLOAT(zoom), M_RANGE(-20.0, 20.0)}, {"video-zoom", OPT_FLOAT(zoom), M_RANGE(-20.0, 20.0)},
{"video-pan-x", OPT_FLOAT(pan_x), M_RANGE(-3.0, 3.0)}, {"video-pan-x", OPT_FLOAT(pan_x), M_RANGE(-3.0, 3.0)},
@ -152,10 +152,10 @@ static const m_option_t mp_vo_opt_list[] = {
{"fs-screen", OPT_CHOICE(fsscreen_id, {"all", -2}, {"current", -1}), {"fs-screen", OPT_CHOICE(fsscreen_id, {"all", -2}, {"current", -1}),
M_RANGE(0, 32)}, M_RANGE(0, 32)},
{"fs-screen-name", OPT_STRING(fsscreen_name)}, {"fs-screen-name", OPT_STRING(fsscreen_name)},
{"keepaspect", OPT_FLAG(keepaspect)}, {"keepaspect", OPT_BOOL(keepaspect)},
{"keepaspect-window", OPT_FLAG(keepaspect_window)}, {"keepaspect-window", OPT_BOOL(keepaspect_window)},
{"hidpi-window-scale", OPT_FLAG(hidpi_window_scale)}, {"hidpi-window-scale", OPT_BOOL(hidpi_window_scale)},
{"native-fs", OPT_FLAG(native_fs)}, {"native-fs", OPT_BOOL(native_fs)},
{"override-display-fps", OPT_DOUBLE(override_display_fps), {"override-display-fps", OPT_DOUBLE(override_display_fps),
M_RANGE(0, DBL_MAX)}, M_RANGE(0, DBL_MAX)},
{"video-timing-offset", OPT_DOUBLE(timing_offset), M_RANGE(0.0, 1.0)}, {"video-timing-offset", OPT_DOUBLE(timing_offset), M_RANGE(0.0, 1.0)},
@ -201,14 +201,13 @@ const struct m_sub_options vo_sub_opts = {
.panscan = 0.0f, .panscan = 0.0f,
.scale_x = 1.0f, .scale_x = 1.0f,
.scale_y = 1.0f, .scale_y = 1.0f,
.keepaspect = 1, .keepaspect = true,
.keepaspect_window = 1, .keepaspect_window = true,
.hidpi_window_scale = 1, .hidpi_window_scale = true,
.native_fs = 1, .native_fs = true,
.taskbar_progress = 1, .taskbar_progress = true,
.snap_window = 0, .border = true,
.border = 1, .fit_border = true,
.fit_border = 1,
.appid = "mpv", .appid = "mpv",
.content_type = -1, .content_type = -1,
.WinID = -1, .WinID = -1,
@ -228,18 +227,18 @@ const struct m_sub_options vo_sub_opts = {
const struct m_sub_options mp_sub_filter_opts = { const struct m_sub_options mp_sub_filter_opts = {
.opts = (const struct m_option[]){ .opts = (const struct m_option[]){
{"sub-filter-sdh", OPT_FLAG(sub_filter_SDH)}, {"sub-filter-sdh", OPT_BOOL(sub_filter_SDH)},
{"sub-filter-sdh-harder", OPT_FLAG(sub_filter_SDH_harder)}, {"sub-filter-sdh-harder", OPT_BOOL(sub_filter_SDH_harder)},
{"sub-filter-regex-enable", OPT_FLAG(rf_enable)}, {"sub-filter-regex-enable", OPT_BOOL(rf_enable)},
{"sub-filter-regex-plain", OPT_FLAG(rf_plain)}, {"sub-filter-regex-plain", OPT_BOOL(rf_plain)},
{"sub-filter-regex", OPT_STRINGLIST(rf_items)}, {"sub-filter-regex", OPT_STRINGLIST(rf_items)},
{"sub-filter-jsre", OPT_STRINGLIST(jsre_items)}, {"sub-filter-jsre", OPT_STRINGLIST(jsre_items)},
{"sub-filter-regex-warn", OPT_FLAG(rf_warn)}, {"sub-filter-regex-warn", OPT_BOOL(rf_warn)},
{0} {0}
}, },
.size = sizeof(OPT_BASE_STRUCT), .size = sizeof(OPT_BASE_STRUCT),
.defaults = &(OPT_BASE_STRUCT){ .defaults = &(OPT_BASE_STRUCT){
.rf_enable = 1, .rf_enable = true,
}, },
.change_flags = UPDATE_SUB_FILT, .change_flags = UPDATE_SUB_FILT,
}; };
@ -252,28 +251,28 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"sub-delay", OPT_FLOAT(sub_delay)}, {"sub-delay", OPT_FLOAT(sub_delay)},
{"sub-fps", OPT_FLOAT(sub_fps)}, {"sub-fps", OPT_FLOAT(sub_fps)},
{"sub-speed", OPT_FLOAT(sub_speed)}, {"sub-speed", OPT_FLOAT(sub_speed)},
{"sub-visibility", OPT_FLAG(sub_visibility)}, {"sub-visibility", OPT_BOOL(sub_visibility)},
{"secondary-sub-visibility", OPT_FLAG(sec_sub_visibility)}, {"secondary-sub-visibility", OPT_BOOL(sec_sub_visibility)},
{"sub-forced-only", OPT_CHOICE(forced_subs_only, {"sub-forced-only", OPT_CHOICE(forced_subs_only,
{"auto", -1}, {"no", 0}, {"yes", 1})}, {"auto", -1}, {"no", 0}, {"yes", 1})},
{"stretch-dvd-subs", OPT_FLAG(stretch_dvd_subs)}, {"stretch-dvd-subs", OPT_BOOL(stretch_dvd_subs)},
{"stretch-image-subs-to-screen", OPT_FLAG(stretch_image_subs)}, {"stretch-image-subs-to-screen", OPT_BOOL(stretch_image_subs)},
{"image-subs-video-resolution", OPT_FLAG(image_subs_video_res)}, {"image-subs-video-resolution", OPT_BOOL(image_subs_video_res)},
{"sub-fix-timing", OPT_FLAG(sub_fix_timing)}, {"sub-fix-timing", OPT_BOOL(sub_fix_timing)},
{"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 150)}, {"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 150)},
{"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)}, {"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)},
{"sub-gray", OPT_FLAG(sub_gray)}, {"sub-gray", OPT_BOOL(sub_gray)},
{"sub-ass", OPT_FLAG(ass_enabled), .flags = UPDATE_SUB_HARD}, {"sub-ass", OPT_BOOL(ass_enabled), .flags = UPDATE_SUB_HARD},
{"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)}, {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},
{"sub-ass-line-spacing", OPT_FLOAT(ass_line_spacing), {"sub-ass-line-spacing", OPT_FLOAT(ass_line_spacing),
M_RANGE(-1000, 1000)}, M_RANGE(-1000, 1000)},
{"sub-use-margins", OPT_FLAG(sub_use_margins)}, {"sub-use-margins", OPT_BOOL(sub_use_margins)},
{"sub-ass-force-margins", OPT_FLAG(ass_use_margins)}, {"sub-ass-force-margins", OPT_BOOL(ass_use_margins)},
{"sub-ass-vsfilter-aspect-compat", OPT_FLAG(ass_vsfilter_aspect_compat)}, {"sub-ass-vsfilter-aspect-compat", OPT_BOOL(ass_vsfilter_aspect_compat)},
{"sub-ass-vsfilter-color-compat", OPT_CHOICE(ass_vsfilter_color_compat, {"sub-ass-vsfilter-color-compat", OPT_CHOICE(ass_vsfilter_color_compat,
{"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})}, {"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})},
{"sub-ass-vsfilter-blur-compat", OPT_FLAG(ass_vsfilter_blur_compat)}, {"sub-ass-vsfilter-blur-compat", OPT_BOOL(ass_vsfilter_blur_compat)},
{"embeddedfonts", OPT_FLAG(use_embedded_fonts), .flags = UPDATE_SUB_HARD}, {"embeddedfonts", OPT_BOOL(use_embedded_fonts), .flags = UPDATE_SUB_HARD},
{"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list), {"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list),
.flags = UPDATE_SUB_HARD}, .flags = UPDATE_SUB_HARD},
{"sub-ass-styles", OPT_STRING(ass_styles_file), {"sub-ass-styles", OPT_STRING(ass_styles_file),
@ -282,39 +281,37 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})}, {"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})},
{"sub-ass-shaper", OPT_CHOICE(ass_shaper, {"sub-ass-shaper", OPT_CHOICE(ass_shaper,
{"simple", 0}, {"complex", 1})}, {"simple", 0}, {"complex", 1})},
{"sub-ass-justify", OPT_FLAG(ass_justify)}, {"sub-ass-justify", OPT_BOOL(ass_justify)},
{"sub-ass-override", OPT_CHOICE(ass_style_override, {"sub-ass-override", OPT_CHOICE(ass_style_override,
{"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})}, {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})},
{"sub-scale-by-window", OPT_FLAG(sub_scale_by_window)}, {"sub-scale-by-window", OPT_BOOL(sub_scale_by_window)},
{"sub-scale-with-window", OPT_FLAG(sub_scale_with_window)}, {"sub-scale-with-window", OPT_BOOL(sub_scale_with_window)},
{"sub-ass-scale-with-window", OPT_FLAG(ass_scale_with_window)}, {"sub-ass-scale-with-window", OPT_BOOL(ass_scale_with_window)},
{"sub", OPT_SUBSTRUCT(sub_style, sub_style_conf)}, {"sub", OPT_SUBSTRUCT(sub_style, sub_style_conf)},
{"sub-clear-on-seek", OPT_FLAG(sub_clear_on_seek)}, {"sub-clear-on-seek", OPT_BOOL(sub_clear_on_seek)},
{"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)}, {"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)},
{"sub-past-video-end", OPT_FLAG(sub_past_video_end)}, {"sub-past-video-end", OPT_BOOL(sub_past_video_end)},
{0} {0}
}, },
.size = sizeof(OPT_BASE_STRUCT), .size = sizeof(OPT_BASE_STRUCT),
.defaults = &(OPT_BASE_STRUCT){ .defaults = &(OPT_BASE_STRUCT){
.sub_visibility = 1, .sub_visibility = true,
.sec_sub_visibility = 1, .sec_sub_visibility = true,
.forced_subs_only = -1, .forced_subs_only = -1,
.sub_pos = 100, .sub_pos = 100,
.sub_speed = 1.0, .sub_speed = 1.0,
.ass_enabled = 1, .ass_enabled = true,
.sub_scale_by_window = 1, .sub_scale_by_window = true,
.ass_use_margins = 0, .sub_use_margins = true,
.sub_use_margins = 1, .sub_scale_with_window = true,
.ass_scale_with_window = 0,
.sub_scale_with_window = 1,
.teletext_page = 100, .teletext_page = 100,
.sub_scale = 1, .sub_scale = 1,
.ass_vsfilter_aspect_compat = 1, .ass_vsfilter_aspect_compat = true,
.ass_vsfilter_color_compat = 1, .ass_vsfilter_color_compat = 1,
.ass_vsfilter_blur_compat = 1, .ass_vsfilter_blur_compat = true,
.ass_style_override = 1, .ass_style_override = 1,
.ass_shaper = 1, .ass_shaper = 1,
.use_embedded_fonts = 1, .use_embedded_fonts = true,
}, },
.change_flags = UPDATE_OSD, .change_flags = UPDATE_OSD,
}; };
@ -330,8 +327,8 @@ const struct m_sub_options mp_osd_render_sub_opts = {
{"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)}, {"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)},
{"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)}, {"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)},
{"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)}, {"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)},
{"osd-scale-by-window", OPT_FLAG(osd_scale_by_window)}, {"osd-scale-by-window", OPT_BOOL(osd_scale_by_window)},
{"force-rgba-osd-rendering", OPT_FLAG(force_rgba_osd)}, {"force-rgba-osd-rendering", OPT_BOOL(force_rgba_osd)},
{0} {0}
}, },
.size = sizeof(OPT_BASE_STRUCT), .size = sizeof(OPT_BASE_STRUCT),
@ -340,7 +337,7 @@ const struct m_sub_options mp_osd_render_sub_opts = {
.osd_bar_w = 75.0, .osd_bar_w = 75.0,
.osd_bar_h = 3.125, .osd_bar_h = 3.125,
.osd_scale = 1, .osd_scale = 1,
.osd_scale_by_window = 1, .osd_scale_by_window = true,
}, },
.change_flags = UPDATE_OSD, .change_flags = UPDATE_OSD,
}; };
@ -366,7 +363,7 @@ const struct m_sub_options dvd_conf = {
const struct m_sub_options filter_conf = { const struct m_sub_options filter_conf = {
.opts = (const struct m_option[]){ .opts = (const struct m_option[]){
{"deinterlace", OPT_FLAG(deinterlace)}, {"deinterlace", OPT_BOOL(deinterlace)},
{0} {0}
}, },
.size = sizeof(OPT_BASE_STRUCT), .size = sizeof(OPT_BASE_STRUCT),
@ -393,7 +390,7 @@ static const m_option_t mp_opts[] = {
M_OPT_OPTIONAL_PARAM, .offset = -1}, M_OPT_OPTIONAL_PARAM, .offset = -1},
{ "list-options", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP, { "list-options", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
.offset = -1}, .offset = -1},
{"list-properties", OPT_FLAG(property_print_help), {"list-properties", OPT_BOOL(property_print_help),
.flags = CONF_NOCFG | M_OPT_NOPROP}, .flags = CONF_NOCFG | M_OPT_NOPROP},
{ "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM, { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
.offset = -1}, .offset = -1},
@ -412,22 +409,22 @@ static const m_option_t mp_opts[] = {
{"cplayer", 0}, {"pseudo-gui", 1}), {"cplayer", 0}, {"pseudo-gui", 1}),
.flags = M_OPT_PRE_PARSE | M_OPT_NOPROP}, .flags = M_OPT_PRE_PARSE | M_OPT_NOPROP},
{"shuffle", OPT_FLAG(shuffle)}, {"shuffle", OPT_BOOL(shuffle)},
// ------------------------- common options -------------------- // ------------------------- common options --------------------
{"quiet", OPT_FLAG(quiet)}, {"quiet", OPT_BOOL(quiet)},
{"really-quiet", OPT_FLAG(msg_really_quiet), {"really-quiet", OPT_BOOL(msg_really_quiet),
.flags = CONF_PRE_PARSE | UPDATE_TERM}, .flags = CONF_PRE_PARSE | UPDATE_TERM},
{"terminal", OPT_FLAG(use_terminal), .flags = CONF_PRE_PARSE | UPDATE_TERM}, {"terminal", OPT_BOOL(use_terminal), .flags = CONF_PRE_PARSE | UPDATE_TERM},
{"msg-level", OPT_MSGLEVELS(msg_levels), {"msg-level", OPT_MSGLEVELS(msg_levels),
.flags = CONF_PRE_PARSE | UPDATE_TERM}, .flags = CONF_PRE_PARSE | UPDATE_TERM},
{"dump-stats", OPT_STRING(dump_stats), {"dump-stats", OPT_STRING(dump_stats),
.flags = UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE}, .flags = UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE},
{"msg-color", OPT_FLAG(msg_color), .flags = CONF_PRE_PARSE | UPDATE_TERM}, {"msg-color", OPT_BOOL(msg_color), .flags = CONF_PRE_PARSE | UPDATE_TERM},
{"log-file", OPT_STRING(log_file), {"log-file", OPT_STRING(log_file),
.flags = CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM}, .flags = CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM},
{"msg-module", OPT_FLAG(msg_module), .flags = UPDATE_TERM}, {"msg-module", OPT_BOOL(msg_module), .flags = UPDATE_TERM},
{"msg-time", OPT_FLAG(msg_time), .flags = UPDATE_TERM}, {"msg-time", OPT_BOOL(msg_time), .flags = UPDATE_TERM},
#if HAVE_WIN32_DESKTOP #if HAVE_WIN32_DESKTOP
{"priority", OPT_CHOICE(w32_priority, {"priority", OPT_CHOICE(w32_priority,
{"no", 0}, {"no", 0},
@ -439,7 +436,7 @@ static const m_option_t mp_opts[] = {
{"idle", IDLE_PRIORITY_CLASS}), {"idle", IDLE_PRIORITY_CLASS}),
.flags = UPDATE_PRIORITY}, .flags = UPDATE_PRIORITY},
#endif #endif
{"config", OPT_FLAG(load_config), .flags = CONF_PRE_PARSE}, {"config", OPT_BOOL(load_config), .flags = CONF_PRE_PARSE},
{"config-dir", OPT_STRING(force_configdir), {"config-dir", OPT_STRING(force_configdir),
.flags = CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE}, .flags = CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE},
{"reset-on-next-file", OPT_STRINGLIST(reset_options)}, {"reset-on-next-file", OPT_STRINGLIST(reset_options)},
@ -448,16 +445,16 @@ static const m_option_t mp_opts[] = {
{"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE}, {"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE},
{"script", OPT_CLI_ALIAS("scripts-append")}, {"script", OPT_CLI_ALIAS("scripts-append")},
{"script-opts", OPT_KEYVALUELIST(script_opts)}, {"script-opts", OPT_KEYVALUELIST(script_opts)},
{"load-scripts", OPT_FLAG(auto_load_scripts)}, {"load-scripts", OPT_BOOL(auto_load_scripts)},
#endif #endif
#if HAVE_LUA #if HAVE_LUA
{"osc", OPT_FLAG(lua_load_osc), .flags = UPDATE_BUILTIN_SCRIPTS}, {"osc", OPT_BOOL(lua_load_osc), .flags = UPDATE_BUILTIN_SCRIPTS},
{"ytdl", OPT_FLAG(lua_load_ytdl), .flags = UPDATE_BUILTIN_SCRIPTS}, {"ytdl", OPT_BOOL(lua_load_ytdl), .flags = UPDATE_BUILTIN_SCRIPTS},
{"ytdl-format", OPT_STRING(lua_ytdl_format)}, {"ytdl-format", OPT_STRING(lua_ytdl_format)},
{"ytdl-raw-options", OPT_KEYVALUELIST(lua_ytdl_raw_options)}, {"ytdl-raw-options", OPT_KEYVALUELIST(lua_ytdl_raw_options)},
{"load-stats-overlay", OPT_FLAG(lua_load_stats), {"load-stats-overlay", OPT_BOOL(lua_load_stats),
.flags = UPDATE_BUILTIN_SCRIPTS}, .flags = UPDATE_BUILTIN_SCRIPTS},
{"load-osd-console", OPT_FLAG(lua_load_console), {"load-osd-console", OPT_BOOL(lua_load_console),
.flags = UPDATE_BUILTIN_SCRIPTS}, .flags = UPDATE_BUILTIN_SCRIPTS},
{"load-auto-profiles", {"load-auto-profiles",
OPT_CHOICE(lua_load_auto_profiles, {"no", 0}, {"yes", 1}, {"auto", -1}), OPT_CHOICE(lua_load_auto_profiles, {"no", 0}, {"yes", 1}, {"auto", -1}),
@ -485,7 +482,7 @@ static const m_option_t mp_opts[] = {
{"play-dir", OPT_CHOICE(play_dir, {"play-dir", OPT_CHOICE(play_dir,
{"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})}, {"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})},
{"rebase-start-time", OPT_FLAG(rebase_start_time)}, {"rebase-start-time", OPT_BOOL(rebase_start_time)},
{"ab-loop-a", OPT_TIME(ab_loop[0]), .flags = M_OPT_ALLOW_NO}, {"ab-loop-a", OPT_TIME(ab_loop[0]), .flags = M_OPT_ALLOW_NO},
{"ab-loop-b", OPT_TIME(ab_loop[1]), .flags = M_OPT_ALLOW_NO}, {"ab-loop-b", OPT_TIME(ab_loop[1]), .flags = M_OPT_ALLOW_NO},
@ -495,12 +492,12 @@ static const m_option_t mp_opts[] = {
{"playlist-start", OPT_CHOICE(playlist_pos, {"auto", -1}, {"no", -1}), {"playlist-start", OPT_CHOICE(playlist_pos, {"auto", -1}, {"no", -1}),
M_RANGE(0, INT_MAX)}, M_RANGE(0, INT_MAX)},
{"pause", OPT_FLAG(pause)}, {"pause", OPT_BOOL(pause)},
{"keep-open", OPT_CHOICE(keep_open, {"keep-open", OPT_CHOICE(keep_open,
{"no", 0}, {"no", 0},
{"yes", 1}, {"yes", 1},
{"always", 2})}, {"always", 2})},
{"keep-open-pause", OPT_FLAG(keep_open_pause)}, {"keep-open-pause", OPT_BOOL(keep_open_pause)},
{"image-display-duration", OPT_DOUBLE(image_display_duration), {"image-display-duration", OPT_DOUBLE(image_display_duration),
M_RANGE(0, INFINITY)}, M_RANGE(0, INFINITY)},
@ -518,8 +515,8 @@ static const m_option_t mp_opts[] = {
{"alang", OPT_STRINGLIST(stream_lang[STREAM_AUDIO])}, {"alang", OPT_STRINGLIST(stream_lang[STREAM_AUDIO])},
{"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])}, {"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])},
{"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])}, {"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])},
{"track-auto-selection", OPT_FLAG(stream_auto_sel)}, {"track-auto-selection", OPT_BOOL(stream_auto_sel)},
{"subs-with-matching-audio", OPT_FLAG(subs_with_matching_audio)}, {"subs-with-matching-audio", OPT_BOOL(subs_with_matching_audio)},
{"lavfi-complex", OPT_STRING(lavfi_complex), .flags = UPDATE_LAVFI_COMPLEX}, {"lavfi-complex", OPT_STRING(lavfi_complex), .flags = UPDATE_LAVFI_COMPLEX},
@ -540,12 +537,12 @@ static const m_option_t mp_opts[] = {
{"demuxer", OPT_STRING(demuxer_name), .help = demuxer_help}, {"demuxer", OPT_STRING(demuxer_name), .help = demuxer_help},
{"audio-demuxer", OPT_STRING(audio_demuxer_name), .help = demuxer_help}, {"audio-demuxer", OPT_STRING(audio_demuxer_name), .help = demuxer_help},
{"sub-demuxer", OPT_STRING(sub_demuxer_name), .help = demuxer_help}, {"sub-demuxer", OPT_STRING(sub_demuxer_name), .help = demuxer_help},
{"demuxer-thread", OPT_FLAG(demuxer_thread)}, {"demuxer-thread", OPT_BOOL(demuxer_thread)},
{"demuxer-termination-timeout", OPT_DOUBLE(demux_termination_timeout)}, {"demuxer-termination-timeout", OPT_DOUBLE(demux_termination_timeout)},
{"demuxer-cache-wait", OPT_FLAG(demuxer_cache_wait)}, {"demuxer-cache-wait", OPT_BOOL(demuxer_cache_wait)},
{"prefetch-playlist", OPT_FLAG(prefetch_open)}, {"prefetch-playlist", OPT_BOOL(prefetch_open)},
{"cache-pause", OPT_FLAG(cache_pause)}, {"cache-pause", OPT_BOOL(cache_pause)},
{"cache-pause-initial", OPT_FLAG(cache_pause_initial)}, {"cache-pause-initial", OPT_BOOL(cache_pause_initial)},
{"cache-pause-wait", OPT_FLOAT(cache_pause_wait), M_RANGE(0, DBL_MAX)}, {"cache-pause-wait", OPT_FLOAT(cache_pause_wait), M_RANGE(0, DBL_MAX)},
{"mf-fps", OPT_DOUBLE(mf_fps)}, {"mf-fps", OPT_DOUBLE(mf_fps)},
@ -566,7 +563,7 @@ static const m_option_t mp_opts[] = {
{"audio-format", OPT_AUDIOFORMAT(audio_output_format), .flags = UPDATE_AUDIO}, {"audio-format", OPT_AUDIOFORMAT(audio_output_format), .flags = UPDATE_AUDIO},
{"speed", OPT_DOUBLE(playback_speed), M_RANGE(0.01, 100.0)}, {"speed", OPT_DOUBLE(playback_speed), M_RANGE(0.01, 100.0)},
{"audio-pitch-correction", OPT_FLAG(pitch_correction)}, {"audio-pitch-correction", OPT_BOOL(pitch_correction)},
// set a-v distance // set a-v distance
{"audio-delay", OPT_FLOAT(audio_delay)}, {"audio-delay", OPT_FLOAT(audio_delay)},
@ -606,7 +603,7 @@ static const m_option_t mp_opts[] = {
{"external-files", OPT_PATHLIST(external_files), .flags = M_OPT_FILE}, {"external-files", OPT_PATHLIST(external_files), .flags = M_OPT_FILE},
{"external-file", OPT_CLI_ALIAS("external-files-append")}, {"external-file", OPT_CLI_ALIAS("external-files-append")},
{"autoload-files", OPT_FLAG(autoload_files)}, {"autoload-files", OPT_BOOL(autoload_files)},
{"sub-auto", OPT_CHOICE(sub_auto, {"sub-auto", OPT_CHOICE(sub_auto,
{"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})}, {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
@ -620,13 +617,13 @@ static const m_option_t mp_opts[] = {
{"", OPT_SUBSTRUCT(subs_filt, mp_sub_filter_opts)}, {"", OPT_SUBSTRUCT(subs_filt, mp_sub_filter_opts)},
{"", OPT_SUBSTRUCT(osd_rend, mp_osd_render_sub_opts)}, {"", OPT_SUBSTRUCT(osd_rend, mp_osd_render_sub_opts)},
{"osd-bar", OPT_FLAG(osd_bar_visible), .flags = UPDATE_OSD}, {"osd-bar", OPT_BOOL(osd_bar_visible), .flags = UPDATE_OSD},
//---------------------- libao/libvo options ------------------------ //---------------------- libao/libvo options ------------------------
{"", OPT_SUBSTRUCT(ao_opts, ao_conf)}, {"", OPT_SUBSTRUCT(ao_opts, ao_conf)},
{"audio-exclusive", OPT_FLAG(audio_exclusive), .flags = UPDATE_AUDIO}, {"audio-exclusive", OPT_BOOL(audio_exclusive), .flags = UPDATE_AUDIO},
{"audio-fallback-to-null", OPT_FLAG(ao_null_fallback)}, {"audio-fallback-to-null", OPT_BOOL(ao_null_fallback)},
{"audio-stream-silence", OPT_FLAG(audio_stream_silence)}, {"audio-stream-silence", OPT_BOOL(audio_stream_silence)},
{"audio-wait-open", OPT_FLOAT(audio_wait_open), M_RANGE(0, 60)}, {"audio-wait-open", OPT_FLOAT(audio_wait_open), M_RANGE(0, 60)},
{"force-window", OPT_CHOICE(force_vo, {"force-window", OPT_CHOICE(force_vo,
{"no", 0}, {"yes", 1}, {"immediate", 2})}, {"no", 0}, {"yes", 1}, {"immediate", 2})},
@ -647,7 +644,7 @@ static const m_option_t mp_opts[] = {
.flags = UPDATE_VOL}, .flags = UPDATE_VOL},
{"replaygain-preamp", OPT_FLOAT(rgain_preamp), .flags = UPDATE_VOL, {"replaygain-preamp", OPT_FLOAT(rgain_preamp), .flags = UPDATE_VOL,
M_RANGE(-150, 150)}, M_RANGE(-150, 150)},
{"replaygain-clip", OPT_FLAG(rgain_clip), .flags = UPDATE_VOL}, {"replaygain-clip", OPT_BOOL(rgain_clip), .flags = UPDATE_VOL},
{"replaygain-fallback", OPT_FLOAT(rgain_fallback), .flags = UPDATE_VOL, {"replaygain-fallback", OPT_FLOAT(rgain_fallback), .flags = UPDATE_VOL,
M_RANGE(-200, 60)}, M_RANGE(-200, 60)},
{"gapless-audio", OPT_CHOICE(gapless_audio, {"gapless-audio", OPT_CHOICE(gapless_audio,
@ -660,7 +657,7 @@ static const m_option_t mp_opts[] = {
{"cursor-autohide", OPT_CHOICE(cursor_autohide_delay, {"cursor-autohide", OPT_CHOICE(cursor_autohide_delay,
{"no", -1}, {"always", -2}), M_RANGE(0, 30000)}, {"no", -1}, {"always", -2}), M_RANGE(0, 30000)},
{"cursor-autohide-fs-only", OPT_FLAG(cursor_autohide_fs)}, {"cursor-autohide-fs-only", OPT_BOOL(cursor_autohide_fs)},
{"stop-screensaver", OPT_CHOICE(stop_screensaver, {"stop-screensaver", OPT_CHOICE(stop_screensaver,
{"no", 0}, {"no", 0},
{"yes", 1}, {"yes", 1},
@ -669,7 +666,7 @@ static const m_option_t mp_opts[] = {
{"", OPT_SUBSTRUCT(video_equalizer, mp_csp_equalizer_conf)}, {"", OPT_SUBSTRUCT(video_equalizer, mp_csp_equalizer_conf)},
{"use-filedir-conf", OPT_FLAG(use_filedir_conf)}, {"use-filedir-conf", OPT_BOOL(use_filedir_conf)},
{"osd-level", OPT_CHOICE(osd_level, {"osd-level", OPT_CHOICE(osd_level,
{"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})}, {"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})},
{"osd-on-seek", OPT_CHOICE(osd_on_seek, {"osd-on-seek", OPT_CHOICE(osd_on_seek,
@ -678,7 +675,7 @@ static const m_option_t mp_opts[] = {
{"msg", 2}, {"msg", 2},
{"msg-bar", 3})}, {"msg-bar", 3})},
{"osd-duration", OPT_INT(osd_duration), M_RANGE(0, 3600000)}, {"osd-duration", OPT_INT(osd_duration), M_RANGE(0, 3600000)},
{"osd-fractions", OPT_FLAG(osd_fractions)}, {"osd-fractions", OPT_BOOL(osd_fractions)},
{"sstep", OPT_DOUBLE(step_sec), M_RANGE(0, DBL_MAX)}, {"sstep", OPT_DOUBLE(step_sec), M_RANGE(0, DBL_MAX)},
@ -687,13 +684,13 @@ static const m_option_t mp_opts[] = {
{"vo", 1}, {"vo", 1},
{"decoder", 2}, {"decoder", 2},
{"decoder+vo", 3})}, {"decoder+vo", 3})},
{"video-latency-hacks", OPT_FLAG(video_latency_hacks)}, {"video-latency-hacks", OPT_BOOL(video_latency_hacks)},
{"untimed", OPT_FLAG(untimed)}, {"untimed", OPT_BOOL(untimed)},
{"stream-dump", OPT_STRING(stream_dump), .flags = M_OPT_FILE}, {"stream-dump", OPT_STRING(stream_dump), .flags = M_OPT_FILE},
{"stop-playback-on-init-failure", OPT_FLAG(stop_playback_on_init_failure)}, {"stop-playback-on-init-failure", OPT_BOOL(stop_playback_on_init_failure)},
{"loop-playlist", OPT_CHOICE(loop_times, {"loop-playlist", OPT_CHOICE(loop_times,
{"no", 1}, {"no", 1},
@ -707,18 +704,18 @@ static const m_option_t mp_opts[] = {
M_RANGE(0, 10000)}, M_RANGE(0, 10000)},
{"loop", OPT_ALIAS("loop-file")}, {"loop", OPT_ALIAS("loop-file")},
{"resume-playback", OPT_FLAG(position_resume)}, {"resume-playback", OPT_BOOL(position_resume)},
{"resume-playback-check-mtime", OPT_FLAG(position_check_mtime)}, {"resume-playback-check-mtime", OPT_BOOL(position_check_mtime)},
{"save-position-on-quit", OPT_FLAG(position_save_on_quit)}, {"save-position-on-quit", OPT_BOOL(position_save_on_quit)},
{"write-filename-in-watch-later-config", {"write-filename-in-watch-later-config",
OPT_FLAG(write_filename_in_watch_later_config)}, OPT_BOOL(write_filename_in_watch_later_config)},
{"ignore-path-in-watch-later-config", {"ignore-path-in-watch-later-config",
OPT_FLAG(ignore_path_in_watch_later_config)}, OPT_BOOL(ignore_path_in_watch_later_config)},
{"watch-later-directory", OPT_STRING(watch_later_directory), {"watch-later-directory", OPT_STRING(watch_later_directory),
.flags = M_OPT_FILE}, .flags = M_OPT_FILE},
{"watch-later-options", OPT_STRINGLIST(watch_later_options)}, {"watch-later-options", OPT_STRINGLIST(watch_later_options)},
{"ordered-chapters", OPT_FLAG(ordered_chapters)}, {"ordered-chapters", OPT_BOOL(ordered_chapters)},
{"ordered-chapters-files", OPT_STRING(ordered_chapters_files), {"ordered-chapters-files", OPT_STRING(ordered_chapters_files),
.flags = M_OPT_FILE}, .flags = M_OPT_FILE},
{"chapter-merge-threshold", OPT_INT(chapter_merge_threshold), {"chapter-merge-threshold", OPT_INT(chapter_merge_threshold),
@ -728,10 +725,10 @@ static const m_option_t mp_opts[] = {
{"chapters-file", OPT_STRING(chapter_file), .flags = M_OPT_FILE}, {"chapters-file", OPT_STRING(chapter_file), .flags = M_OPT_FILE},
{"merge-files", OPT_FLAG(merge_files)}, {"merge-files", OPT_BOOL(merge_files)},
// a-v sync stuff: // a-v sync stuff:
{"initial-audio-sync", OPT_FLAG(initial_audio_sync)}, {"initial-audio-sync", OPT_BOOL(initial_audio_sync)},
{"video-sync-max-video-change", OPT_DOUBLE(sync_max_video_change), {"video-sync-max-video-change", OPT_DOUBLE(sync_max_video_change),
M_RANGE(0, DBL_MAX)}, M_RANGE(0, DBL_MAX)},
{"video-sync-max-audio-change", OPT_DOUBLE(sync_max_audio_change), {"video-sync-max-audio-change", OPT_DOUBLE(sync_max_audio_change),
@ -740,13 +737,13 @@ static const m_option_t mp_opts[] = {
{"hr-seek", OPT_CHOICE(hr_seek, {"hr-seek", OPT_CHOICE(hr_seek,
{"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1}, {"default", 2})}, {"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1}, {"default", 2})},
{"hr-seek-demuxer-offset", OPT_FLOAT(hr_seek_demuxer_offset)}, {"hr-seek-demuxer-offset", OPT_FLOAT(hr_seek_demuxer_offset)},
{"hr-seek-framedrop", OPT_FLAG(hr_seek_framedrop)}, {"hr-seek-framedrop", OPT_BOOL(hr_seek_framedrop)},
{"autosync", OPT_CHOICE(autosync, {"no", -1}), M_RANGE(0, 10000)}, {"autosync", OPT_CHOICE(autosync, {"no", -1}), M_RANGE(0, 10000)},
{"term-osd", OPT_CHOICE(term_osd, {"term-osd", OPT_CHOICE(term_osd,
{"force", 1}, {"auto", 2}, {"no", 0}), .flags = UPDATE_OSD}, {"force", 1}, {"auto", 2}, {"no", 0}), .flags = UPDATE_OSD},
{"term-osd-bar", OPT_FLAG(term_osd_bar), .flags = UPDATE_OSD}, {"term-osd-bar", OPT_BOOL(term_osd_bar), .flags = UPDATE_OSD},
{"term-osd-bar-chars", OPT_STRING(term_osd_bar_chars), .flags = UPDATE_OSD}, {"term-osd-bar-chars", OPT_STRING(term_osd_bar_chars), .flags = UPDATE_OSD},
{"term-title", OPT_STRING(term_title), .flags = UPDATE_OSD}, {"term-title", OPT_STRING(term_title), .flags = UPDATE_OSD},
@ -760,12 +757,12 @@ static const m_option_t mp_opts[] = {
{"osd-msg2", OPT_STRING(osd_msg[1]), .flags = UPDATE_OSD}, {"osd-msg2", OPT_STRING(osd_msg[1]), .flags = UPDATE_OSD},
{"osd-msg3", OPT_STRING(osd_msg[2]), .flags = UPDATE_OSD}, {"osd-msg3", OPT_STRING(osd_msg[2]), .flags = UPDATE_OSD},
{"video-osd", OPT_FLAG(video_osd), .flags = UPDATE_OSD}, {"video-osd", OPT_BOOL(video_osd), .flags = UPDATE_OSD},
{"idle", OPT_CHOICE(player_idle_mode, {"idle", OPT_CHOICE(player_idle_mode,
{"no", 0}, {"once", 1}, {"yes", 2})}, {"no", 0}, {"once", 1}, {"yes", 2})},
{"input-terminal", OPT_FLAG(consolecontrols), .flags = UPDATE_TERM}, {"input-terminal", OPT_BOOL(consolecontrols), .flags = UPDATE_TERM},
{"input-ipc-server", OPT_STRING(ipc_path), .flags = M_OPT_FILE}, {"input-ipc-server", OPT_STRING(ipc_path), .flags = M_OPT_FILE},
#if HAVE_POSIX #if HAVE_POSIX
@ -973,8 +970,8 @@ static const m_option_t mp_opts[] = {
}; };
static const struct MPOpts mp_default_opts = { static const struct MPOpts mp_default_opts = {
.use_terminal = 1, .use_terminal = true,
.msg_color = 1, .msg_color = true,
.softvol_max = 130, .softvol_max = 130,
.softvol_volume = 100, .softvol_volume = 100,
.softvol_mute = 0, .softvol_mute = 0,
@ -982,51 +979,51 @@ static const struct MPOpts mp_default_opts = {
.wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv", .wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv",
.stop_screensaver = 1, .stop_screensaver = 1,
.cursor_autohide_delay = 1000, .cursor_autohide_delay = 1000,
.video_osd = 1, .video_osd = true,
.osd_level = 1, .osd_level = 1,
.osd_on_seek = 1, .osd_on_seek = 1,
.osd_duration = 1000, .osd_duration = 1000,
#if HAVE_LUA #if HAVE_LUA
.lua_load_osc = 1, .lua_load_osc = true,
.lua_load_ytdl = 1, .lua_load_ytdl = true,
.lua_ytdl_format = NULL, .lua_ytdl_format = NULL,
.lua_ytdl_raw_options = NULL, .lua_ytdl_raw_options = NULL,
.lua_load_stats = 1, .lua_load_stats = true,
.lua_load_console = 1, .lua_load_console = true,
.lua_load_auto_profiles = -1, .lua_load_auto_profiles = -1,
#endif #endif
.auto_load_scripts = 1, .auto_load_scripts = true,
.loop_times = 1, .loop_times = 1,
.ordered_chapters = 1, .ordered_chapters = true,
.chapter_merge_threshold = 100, .chapter_merge_threshold = 100,
.chapter_seek_threshold = 5.0, .chapter_seek_threshold = 5.0,
.hr_seek = 2, .hr_seek = 2,
.hr_seek_framedrop = 1, .hr_seek_framedrop = true,
.sync_max_video_change = 1, .sync_max_video_change = 1,
.sync_max_audio_change = 0.125, .sync_max_audio_change = 0.125,
.sync_max_factor = 5, .sync_max_factor = 5,
.load_config = 1, .load_config = true,
.position_resume = 1, .position_resume = true,
.autoload_files = 1, .autoload_files = true,
.demuxer_thread = 1, .demuxer_thread = true,
.demux_termination_timeout = 0.1, .demux_termination_timeout = 0.1,
.hls_bitrate = INT_MAX, .hls_bitrate = INT_MAX,
.cache_pause = 1, .cache_pause = true,
.cache_pause_wait = 1.0, .cache_pause_wait = 1.0,
.ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE}, .ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
.ab_loop_count = -1, .ab_loop_count = -1,
.edition_id = -1, .edition_id = -1,
.default_max_pts_correction = -1, .default_max_pts_correction = -1,
.initial_audio_sync = 1, .initial_audio_sync = true,
.frame_dropping = 1, .frame_dropping = 1,
.term_osd = 2, .term_osd = 2,
.term_osd_bar_chars = "[-+-]", .term_osd_bar_chars = "[-+-]",
.consolecontrols = 1, .consolecontrols = true,
.playlist_pos = -1, .playlist_pos = -1,
.play_frames = -1, .play_frames = -1,
.rebase_start_time = 1, .rebase_start_time = true,
.keep_open = 0, .keep_open = 0,
.keep_open_pause = 1, .keep_open_pause = true,
.image_display_duration = 1.0, .image_display_duration = 1.0,
.stream_id = { { [STREAM_AUDIO] = -1, .stream_id = { { [STREAM_AUDIO] = -1,
[STREAM_VIDEO] = -1, [STREAM_VIDEO] = -1,
@ -1034,17 +1031,17 @@ static const struct MPOpts mp_default_opts = {
{ [STREAM_AUDIO] = -2, { [STREAM_AUDIO] = -2,
[STREAM_VIDEO] = -2, [STREAM_VIDEO] = -2,
[STREAM_SUB] = -2, }, }, [STREAM_SUB] = -2, }, },
.stream_auto_sel = 1, .stream_auto_sel = true,
.subs_with_matching_audio = 1, .subs_with_matching_audio = true,
.audio_display = 1, .audio_display = 1,
.audio_output_format = 0, // AF_FORMAT_UNKNOWN .audio_output_format = 0, // AF_FORMAT_UNKNOWN
.playback_speed = 1., .playback_speed = 1.,
.pitch_correction = 1, .pitch_correction = true,
.sub_auto = 0, .sub_auto = 0,
.audiofile_auto = -1, .audiofile_auto = -1,
.coverart_auto = 0, .coverart_auto = 0,
.coverart_whitelist = true, .coverart_whitelist = true,
.osd_bar_visible = 1, .osd_bar_visible = true,
.screenshot_template = "mpv-shot%n", .screenshot_template = "mpv-shot%n",
.play_dir = 1, .play_dir = 1,

View File

@ -9,16 +9,16 @@
typedef struct mp_vo_opts { typedef struct mp_vo_opts {
struct m_obj_settings *video_driver_list; struct m_obj_settings *video_driver_list;
int taskbar_progress; bool taskbar_progress;
int snap_window; bool snap_window;
int ontop; bool ontop;
int ontop_level; int ontop_level;
bool fullscreen; bool fullscreen;
int border; bool border;
int fit_border; bool fit_border;
int all_workspaces; bool all_workspaces;
int window_minimized; bool window_minimized;
int window_maximized; bool window_maximized;
bool focus_on_open; bool focus_on_open;
int screen_id; int screen_id;
@ -31,7 +31,7 @@ typedef struct mp_vo_opts {
int x11_netwm; int x11_netwm;
int x11_bypass_compositor; int x11_bypass_compositor;
int x11_present; int x11_present;
int native_keyrepeat; bool native_keyrepeat;
float panscan; float panscan;
float zoom; float zoom;
@ -48,17 +48,17 @@ typedef struct mp_vo_opts {
struct m_geometry autofit_smaller; struct m_geometry autofit_smaller;
double window_scale; double window_scale;
int keepaspect; bool keepaspect;
int keepaspect_window; bool keepaspect_window;
int hidpi_window_scale; bool hidpi_window_scale;
int native_fs; bool native_fs;
int64_t WinID; int64_t WinID;
float force_monitor_aspect; float force_monitor_aspect;
float monitor_pixel_aspect; float monitor_pixel_aspect;
int force_render; bool force_render;
int force_window_position; bool force_window_position;
char *mmcss_profile; char *mmcss_profile;
@ -73,52 +73,52 @@ typedef struct mp_vo_opts {
// Subtitle options needed by the subtitle decoders/renderers. // Subtitle options needed by the subtitle decoders/renderers.
struct mp_subtitle_opts { struct mp_subtitle_opts {
int sub_visibility; bool sub_visibility;
int sec_sub_visibility; bool sec_sub_visibility;
int sub_pos; int sub_pos;
float sub_delay; float sub_delay;
float sub_fps; float sub_fps;
float sub_speed; float sub_speed;
int forced_subs_only; int forced_subs_only;
int forced_subs_only_current; int forced_subs_only_current;
int stretch_dvd_subs; bool stretch_dvd_subs;
int stretch_image_subs; bool stretch_image_subs;
int image_subs_video_res; bool image_subs_video_res;
int sub_fix_timing; bool sub_fix_timing;
int sub_scale_by_window; bool sub_scale_by_window;
int sub_scale_with_window; bool sub_scale_with_window;
int ass_scale_with_window; bool ass_scale_with_window;
struct osd_style_opts *sub_style; struct osd_style_opts *sub_style;
float sub_scale; float sub_scale;
float sub_gauss; float sub_gauss;
int sub_gray; bool sub_gray;
int ass_enabled; bool ass_enabled;
float ass_line_spacing; float ass_line_spacing;
int ass_use_margins; bool ass_use_margins;
int sub_use_margins; bool sub_use_margins;
int ass_vsfilter_aspect_compat; bool ass_vsfilter_aspect_compat;
int ass_vsfilter_color_compat; int ass_vsfilter_color_compat;
int ass_vsfilter_blur_compat; bool ass_vsfilter_blur_compat;
int use_embedded_fonts; bool use_embedded_fonts;
char **ass_force_style_list; char **ass_force_style_list;
char *ass_styles_file; char *ass_styles_file;
int ass_style_override; int ass_style_override;
int ass_hinting; int ass_hinting;
int ass_shaper; int ass_shaper;
int ass_justify; bool ass_justify;
int sub_clear_on_seek; bool sub_clear_on_seek;
int teletext_page; int teletext_page;
int sub_past_video_end; bool sub_past_video_end;
}; };
struct mp_sub_filter_opts { struct mp_sub_filter_opts {
int sub_filter_SDH; bool sub_filter_SDH;
int sub_filter_SDH_harder; bool sub_filter_SDH_harder;
int rf_enable; bool rf_enable;
int rf_plain; bool rf_plain;
char **rf_items; char **rf_items;
char **jsre_items; char **jsre_items;
int rf_warn; bool rf_warn;
}; };
struct mp_osd_render_opts { struct mp_osd_render_opts {
@ -127,21 +127,21 @@ struct mp_osd_render_opts {
float osd_bar_w; float osd_bar_w;
float osd_bar_h; float osd_bar_h;
float osd_scale; float osd_scale;
int osd_scale_by_window; bool osd_scale_by_window;
struct osd_style_opts *osd_style; struct osd_style_opts *osd_style;
int force_rgba_osd; bool force_rgba_osd;
}; };
typedef struct MPOpts { typedef struct MPOpts {
int property_print_help; bool property_print_help;
int use_terminal; bool use_terminal;
char *dump_stats; char *dump_stats;
int verbose; int verbose;
int msg_really_quiet; bool msg_really_quiet;
char **msg_levels; char **msg_levels;
int msg_color; bool msg_color;
int msg_module; bool msg_module;
int msg_time; bool msg_time;
char *log_file; char *log_file;
char *test_mode; char *test_mode;
@ -150,25 +150,25 @@ typedef struct MPOpts {
char **reset_options; char **reset_options;
char **script_files; char **script_files;
char **script_opts; char **script_opts;
int lua_load_osc; bool lua_load_osc;
int lua_load_ytdl; bool lua_load_ytdl;
char *lua_ytdl_format; char *lua_ytdl_format;
char **lua_ytdl_raw_options; char **lua_ytdl_raw_options;
int lua_load_stats; bool lua_load_stats;
int lua_load_console; bool lua_load_console;
int lua_load_auto_profiles; int lua_load_auto_profiles;
int auto_load_scripts; bool auto_load_scripts;
int audio_exclusive; bool audio_exclusive;
int ao_null_fallback; bool ao_null_fallback;
int audio_stream_silence; bool audio_stream_silence;
float audio_wait_open; float audio_wait_open;
int force_vo; int force_vo;
float softvol_volume; float softvol_volume;
int rgain_mode; int rgain_mode;
float rgain_preamp; // Set replaygain pre-amplification float rgain_preamp; // Set replaygain pre-amplification
int rgain_clip; // Enable/disable clipping prevention bool rgain_clip; // Enable/disable clipping prevention
float rgain_fallback; float rgain_fallback;
int softvol_mute; int softvol_mute;
float softvol_max; float softvol_max;
@ -184,7 +184,7 @@ typedef struct MPOpts {
int stop_screensaver; int stop_screensaver;
int cursor_autohide_delay; int cursor_autohide_delay;
int cursor_autohide_fs; bool cursor_autohide_fs;
struct mp_subtitle_opts *subs_rend; struct mp_subtitle_opts *subs_rend;
struct mp_sub_filter_opts *subs_filt; struct mp_sub_filter_opts *subs_filt;
@ -192,43 +192,43 @@ typedef struct MPOpts {
int osd_level; int osd_level;
int osd_duration; int osd_duration;
int osd_fractions; bool osd_fractions;
int osd_on_seek; int osd_on_seek;
int video_osd; bool video_osd;
int untimed; bool untimed;
char *stream_dump; char *stream_dump;
char *record_file; char *record_file;
int stop_playback_on_init_failure; bool stop_playback_on_init_failure;
int loop_times; int loop_times;
int loop_file; int loop_file;
int shuffle; bool shuffle;
int ordered_chapters; bool ordered_chapters;
char *ordered_chapters_files; char *ordered_chapters_files;
int chapter_merge_threshold; int chapter_merge_threshold;
double chapter_seek_threshold; double chapter_seek_threshold;
char *chapter_file; char *chapter_file;
int merge_files; bool merge_files;
int quiet; bool quiet;
int load_config; bool load_config;
char *force_configdir; char *force_configdir;
int use_filedir_conf; bool use_filedir_conf;
int hls_bitrate; int hls_bitrate;
int edition_id; int edition_id;
int initial_audio_sync; bool initial_audio_sync;
double sync_max_video_change; double sync_max_video_change;
double sync_max_audio_change; double sync_max_audio_change;
int sync_max_factor; int sync_max_factor;
int hr_seek; int hr_seek;
float hr_seek_demuxer_offset; float hr_seek_demuxer_offset;
int hr_seek_framedrop; bool hr_seek_framedrop;
float audio_delay; float audio_delay;
float default_max_pts_correction; float default_max_pts_correction;
int autosync; int autosync;
int frame_dropping; int frame_dropping;
int video_latency_hacks; bool video_latency_hacks;
int term_osd; int term_osd;
int term_osd_bar; bool term_osd_bar;
char *term_osd_bar_chars; char *term_osd_bar_chars;
char *term_title; char *term_title;
char *playing_msg; char *playing_msg;
@ -238,47 +238,47 @@ typedef struct MPOpts {
char *osd_status_msg; char *osd_status_msg;
char *osd_msg[3]; char *osd_msg[3];
int player_idle_mode; int player_idle_mode;
int consolecontrols; bool consolecontrols;
int playlist_pos; int playlist_pos;
struct m_rel_time play_start; struct m_rel_time play_start;
struct m_rel_time play_end; struct m_rel_time play_end;
struct m_rel_time play_length; struct m_rel_time play_length;
int play_dir; int play_dir;
int rebase_start_time; bool rebase_start_time;
int play_frames; int play_frames;
double ab_loop[2]; double ab_loop[2];
int ab_loop_count; int ab_loop_count;
double step_sec; double step_sec;
int position_resume; bool position_resume;
int position_check_mtime; bool position_check_mtime;
int position_save_on_quit; bool position_save_on_quit;
int write_filename_in_watch_later_config; bool write_filename_in_watch_later_config;
int ignore_path_in_watch_later_config; bool ignore_path_in_watch_later_config;
char *watch_later_directory; char *watch_later_directory;
char **watch_later_options; char **watch_later_options;
int pause; bool pause;
int keep_open; int keep_open;
int keep_open_pause; bool keep_open_pause;
double image_display_duration; double image_display_duration;
char *lavfi_complex; char *lavfi_complex;
int stream_id[2][STREAM_TYPE_COUNT]; int stream_id[2][STREAM_TYPE_COUNT];
char **stream_lang[STREAM_TYPE_COUNT]; char **stream_lang[STREAM_TYPE_COUNT];
int stream_auto_sel; bool stream_auto_sel;
int subs_with_matching_audio; bool subs_with_matching_audio;
int audio_display; int audio_display;
char **display_tags; char **display_tags;
char **audio_files; char **audio_files;
char *demuxer_name; char *demuxer_name;
int demuxer_thread; bool demuxer_thread;
double demux_termination_timeout; double demux_termination_timeout;
int demuxer_cache_wait; bool demuxer_cache_wait;
int prefetch_open; bool prefetch_open;
char *audio_demuxer_name; char *audio_demuxer_name;
char *sub_demuxer_name; char *sub_demuxer_name;
int cache_pause; bool cache_pause;
int cache_pause_initial; bool cache_pause_initial;
float cache_pause_wait; float cache_pause_wait;
struct image_writer_opts *screenshot_image_opts; struct image_writer_opts *screenshot_image_opts;
@ -292,7 +292,7 @@ typedef struct MPOpts {
int audio_output_format; int audio_output_format;
int force_srate; int force_srate;
double playback_speed; double playback_speed;
int pitch_correction; bool pitch_correction;
struct m_obj_settings *vf_settings, *vf_defs; struct m_obj_settings *vf_settings, *vf_defs;
struct m_obj_settings *af_settings, *af_defs; struct m_obj_settings *af_settings, *af_defs;
struct filter_opts *filter_opts; struct filter_opts *filter_opts;
@ -302,12 +302,12 @@ typedef struct MPOpts {
char **audiofile_paths; char **audiofile_paths;
char **coverart_files; char **coverart_files;
char **external_files; char **external_files;
int autoload_files; bool autoload_files;
int sub_auto; int sub_auto;
int audiofile_auto; int audiofile_auto;
int coverart_auto; int coverart_auto;
bool coverart_whitelist; bool coverart_whitelist;
int osd_bar_visible; bool osd_bar_visible;
int w32_priority; int w32_priority;
@ -374,7 +374,7 @@ struct dvd_opts {
}; };
struct filter_opts { struct filter_opts {
int deinterlace; bool deinterlace;
}; };
extern const struct m_sub_options vo_sub_opts; extern const struct m_sub_options vo_sub_opts;

View File

@ -92,14 +92,14 @@ class MPVHelper {
} }
func setOption(minimized: Bool) { func setOption(minimized: Bool) {
optsPtr.pointee.window_minimized = Int32(minimized) optsPtr.pointee.window_minimized = minimized
_ = withUnsafeMutableBytes(of: &optsPtr.pointee.window_minimized) { (ptr: UnsafeMutableRawBufferPointer) in _ = withUnsafeMutableBytes(of: &optsPtr.pointee.window_minimized) { (ptr: UnsafeMutableRawBufferPointer) in
m_config_cache_write_opt(optsCachePtr, ptr.baseAddress) m_config_cache_write_opt(optsCachePtr, ptr.baseAddress)
} }
} }
func setOption(maximized: Bool) { func setOption(maximized: Bool) {
optsPtr.pointee.window_maximized = Int32(maximized) optsPtr.pointee.window_maximized = maximized
_ = withUnsafeMutableBytes(of: &optsPtr.pointee.window_maximized) { (ptr: UnsafeMutableRawBufferPointer) in _ = withUnsafeMutableBytes(of: &optsPtr.pointee.window_maximized) { (ptr: UnsafeMutableRawBufferPointer) in
m_config_cache_write_opt(optsCachePtr, ptr.baseAddress) m_config_cache_write_opt(optsCachePtr, ptr.baseAddress)
} }

View File

@ -32,11 +32,11 @@ struct macos_opts {
int macos_title_bar_material; int macos_title_bar_material;
struct m_color macos_title_bar_color; struct m_color macos_title_bar_color;
int macos_fs_animation_duration; int macos_fs_animation_duration;
int macos_force_dedicated_gpu; bool macos_force_dedicated_gpu;
int macos_app_activation_policy; int macos_app_activation_policy;
int macos_geometry_calculation; int macos_geometry_calculation;
int cocoa_cb_sw_renderer; int cocoa_cb_sw_renderer;
int cocoa_cb_10bit_context; bool cocoa_cb_10bit_context;
}; };
// multithreaded wrapper for mpv_main // multithreaded wrapper for mpv_main

View File

@ -62,14 +62,14 @@ const struct m_sub_options macos_conf = {
{"macos-fs-animation-duration", {"macos-fs-animation-duration",
OPT_CHOICE(macos_fs_animation_duration, {"default", -1}), OPT_CHOICE(macos_fs_animation_duration, {"default", -1}),
M_RANGE(0, 1000)}, M_RANGE(0, 1000)},
{"macos-force-dedicated-gpu", OPT_FLAG(macos_force_dedicated_gpu)}, {"macos-force-dedicated-gpu", OPT_BOOL(macos_force_dedicated_gpu)},
{"macos-app-activation-policy", OPT_CHOICE(macos_app_activation_policy, {"macos-app-activation-policy", OPT_CHOICE(macos_app_activation_policy,
{"regular", 0}, {"accessory", 1}, {"prohibited", 2})}, {"regular", 0}, {"accessory", 1}, {"prohibited", 2})},
{"macos-geometry-calculation", OPT_CHOICE(macos_geometry_calculation, {"macos-geometry-calculation", OPT_CHOICE(macos_geometry_calculation,
{"visible", FRAME_VISIBLE}, {"whole", FRAME_WHOLE})}, {"visible", FRAME_VISIBLE}, {"whole", FRAME_WHOLE})},
{"cocoa-cb-sw-renderer", OPT_CHOICE(cocoa_cb_sw_renderer, {"cocoa-cb-sw-renderer", OPT_CHOICE(cocoa_cb_sw_renderer,
{"auto", -1}, {"no", 0}, {"yes", 1})}, {"auto", -1}, {"no", 0}, {"yes", 1})},
{"cocoa-cb-10bit-context", OPT_FLAG(cocoa_cb_10bit_context)}, {"cocoa-cb-10bit-context", OPT_BOOL(cocoa_cb_10bit_context)},
{"macos-title-bar-style", OPT_REMOVED("Split into --macos-title-bar-appearance " {"macos-title-bar-style", OPT_REMOVED("Split into --macos-title-bar-appearance "
"and --macos-title-bar-material")}, "and --macos-title-bar-material")},
{0} {0}
@ -79,7 +79,7 @@ const struct m_sub_options macos_conf = {
.macos_title_bar_color = {0, 0, 0, 0}, .macos_title_bar_color = {0, 0, 0, 0},
.macos_fs_animation_duration = -1, .macos_fs_animation_duration = -1,
.cocoa_cb_sw_renderer = -1, .cocoa_cb_sw_renderer = -1,
.cocoa_cb_10bit_context = 1 .cocoa_cb_10bit_context = true
}, },
}; };

View File

@ -1691,7 +1691,7 @@ terminate_playback:
update_core_idle_state(mpctx); update_core_idle_state(mpctx);
if (mpctx->step_frames) { if (mpctx->step_frames) {
opts->pause = 1; opts->pause = true;
m_config_notify_change_opt_ptr(mpctx->mconfig, &opts->pause); m_config_notify_change_opt_ptr(mpctx->mconfig, &opts->pause);
} }

View File

@ -91,7 +91,7 @@ typedef struct {
int cfg_devno; int cfg_devno;
int cfg_timeout; int cfg_timeout;
char *cfg_file; char *cfg_file;
int cfg_full_transponder; bool cfg_full_transponder;
int cfg_channel_switch_offset; int cfg_channel_switch_offset;
} dvb_opts_t; } dvb_opts_t;

View File

@ -103,7 +103,7 @@ static const stream_info_t *const stream_list[] = {
struct stream_opts { struct stream_opts {
int64_t buffer_size; int64_t buffer_size;
int load_unsafe_playlists; bool load_unsafe_playlists;
}; };
#define OPT_BASE_STRUCT struct stream_opts #define OPT_BASE_STRUCT struct stream_opts
@ -112,7 +112,7 @@ const struct m_sub_options stream_conf = {
.opts = (const struct m_option[]){ .opts = (const struct m_option[]){
{"stream-buffer-size", OPT_BYTE_SIZE(buffer_size), {"stream-buffer-size", OPT_BYTE_SIZE(buffer_size),
M_RANGE(STREAM_MIN_BUFFER_SIZE, STREAM_MAX_BUFFER_SIZE)}, M_RANGE(STREAM_MIN_BUFFER_SIZE, STREAM_MAX_BUFFER_SIZE)},
{"load-unsafe-playlists", OPT_FLAG(load_unsafe_playlists)}, {"load-unsafe-playlists", OPT_BOOL(load_unsafe_playlists)},
{0} {0}
}, },
.size = sizeof(struct stream_opts), .size = sizeof(struct stream_opts),
@ -353,8 +353,8 @@ static int stream_create_instance(const stream_info_t *sinfo,
if (flags & STREAM_LESS_NOISE) if (flags & STREAM_LESS_NOISE)
mp_msg_set_max_level(s->log, MSGL_WARN); mp_msg_set_max_level(s->log, MSGL_WARN);
int opt; bool opt;
mp_read_option_raw(s->global, "access-references", &m_option_type_flag, &opt); mp_read_option_raw(s->global, "access-references", &m_option_type_bool, &opt);
s->access_references = opt; s->access_references = opt;
MP_VERBOSE(s, "Opening %s\n", url); MP_VERBOSE(s, "Opening %s\n", url);

View File

@ -67,10 +67,10 @@ typedef struct cdda_params {
int search_overlap; int search_overlap;
int toc_bias; int toc_bias;
int toc_offset; int toc_offset;
int skip; bool skip;
char *device; char *device;
int span[2]; int span[2];
int cdtext; bool cdtext;
} cdda_priv; } cdda_priv;
#define OPT_BASE_STRUCT struct cdda_params #define OPT_BASE_STRUCT struct cdda_params
@ -82,17 +82,17 @@ const struct m_sub_options stream_cdda_conf = {
{"overlap", OPT_INT(search_overlap), M_RANGE(0, 75)}, {"overlap", OPT_INT(search_overlap), M_RANGE(0, 75)},
{"toc-bias", OPT_INT(toc_bias)}, {"toc-bias", OPT_INT(toc_bias)},
{"toc-offset", OPT_INT(toc_offset)}, {"toc-offset", OPT_INT(toc_offset)},
{"skip", OPT_FLAG(skip)}, {"skip", OPT_BOOL(skip)},
{"span-a", OPT_INT(span[0])}, {"span-a", OPT_INT(span[0])},
{"span-b", OPT_INT(span[1])}, {"span-b", OPT_INT(span[1])},
{"cdtext", OPT_FLAG(cdtext)}, {"cdtext", OPT_BOOL(cdtext)},
{"span", OPT_REMOVED("use span-a/span-b")}, {"span", OPT_REMOVED("use span-a/span-b")},
{0} {0}
}, },
.size = sizeof(struct cdda_params), .size = sizeof(struct cdda_params),
.defaults = &(const struct cdda_params){ .defaults = &(const struct cdda_params){
.search_overlap = -1, .search_overlap = -1,
.skip = 1, .skip = true,
}, },
}; };

View File

@ -77,7 +77,7 @@ const struct m_sub_options stream_dvb_conf = {
{"card", OPT_INT(cfg_devno), M_RANGE(0, MAX_ADAPTERS-1)}, {"card", OPT_INT(cfg_devno), M_RANGE(0, MAX_ADAPTERS-1)},
{"timeout", OPT_INT(cfg_timeout), M_RANGE(1, 30)}, {"timeout", OPT_INT(cfg_timeout), M_RANGE(1, 30)},
{"file", OPT_STRING(cfg_file), .flags = M_OPT_FILE}, {"file", OPT_STRING(cfg_file), .flags = M_OPT_FILE},
{"full-transponder", OPT_FLAG(cfg_full_transponder)}, {"full-transponder", OPT_BOOL(cfg_full_transponder)},
{"channel-switch-offset", OPT_INT(cfg_channel_switch_offset), {"channel-switch-offset", OPT_INT(cfg_channel_switch_offset),
.flags = UPDATE_DVB_PROG}, .flags = UPDATE_DVB_PROG},
{0} {0}

View File

@ -37,12 +37,12 @@
#define OPT_BASE_STRUCT struct stream_lavf_params #define OPT_BASE_STRUCT struct stream_lavf_params
struct stream_lavf_params { struct stream_lavf_params {
char **avopts; char **avopts;
int cookies_enabled; bool cookies_enabled;
char *cookies_file; char *cookies_file;
char *useragent; char *useragent;
char *referrer; char *referrer;
char **http_header_fields; char **http_header_fields;
int tls_verify; bool tls_verify;
char *tls_ca_file; char *tls_ca_file;
char *tls_cert_file; char *tls_cert_file;
char *tls_key_file; char *tls_key_file;
@ -56,9 +56,9 @@ const struct m_sub_options stream_lavf_conf = {
{"http-header-fields", OPT_STRINGLIST(http_header_fields)}, {"http-header-fields", OPT_STRINGLIST(http_header_fields)},
{"user-agent", OPT_STRING(useragent)}, {"user-agent", OPT_STRING(useragent)},
{"referrer", OPT_STRING(referrer)}, {"referrer", OPT_STRING(referrer)},
{"cookies", OPT_FLAG(cookies_enabled)}, {"cookies", OPT_BOOL(cookies_enabled)},
{"cookies-file", OPT_STRING(cookies_file), .flags = M_OPT_FILE}, {"cookies-file", OPT_STRING(cookies_file), .flags = M_OPT_FILE},
{"tls-verify", OPT_FLAG(tls_verify)}, {"tls-verify", OPT_BOOL(tls_verify)},
{"tls-ca-file", OPT_STRING(tls_ca_file), .flags = M_OPT_FILE}, {"tls-ca-file", OPT_STRING(tls_ca_file), .flags = M_OPT_FILE},
{"tls-cert-file", OPT_STRING(tls_cert_file), .flags = M_OPT_FILE}, {"tls-cert-file", OPT_STRING(tls_cert_file), .flags = M_OPT_FILE},
{"tls-key-file", OPT_STRING(tls_key_file), .flags = M_OPT_FILE}, {"tls-key-file", OPT_STRING(tls_key_file), .flags = M_OPT_FILE},

View File

@ -177,5 +177,4 @@ const stream_info_t stream_info_slice = {
.name = "slice", .name = "slice",
.open2 = open2, .open2 = open2,
.protocols = (const char*const[]){ "slice", NULL }, .protocols = (const char*const[]){ "slice", NULL },
.can_write = false,
}; };

View File

@ -61,8 +61,8 @@ static const m_option_t style_opts[] = {
{"align-y", OPT_CHOICE(align_y, {"align-y", OPT_CHOICE(align_y,
{"top", -1}, {"center", 0}, {"bottom", +1})}, {"top", -1}, {"center", 0}, {"bottom", +1})},
{"blur", OPT_FLOAT(blur), M_RANGE(0, 20)}, {"blur", OPT_FLOAT(blur), M_RANGE(0, 20)},
{"bold", OPT_FLAG(bold)}, {"bold", OPT_BOOL(bold)},
{"italic", OPT_FLAG(italic)}, {"italic", OPT_BOOL(italic)},
{"justify", OPT_CHOICE(justify, {"justify", OPT_CHOICE(justify,
{"auto", 0}, {"left", 1}, {"center", 2}, {"right", 3})}, {"auto", 0}, {"left", 1}, {"center", 2}, {"right", 3})},
{"font-provider", OPT_CHOICE(font_provider, {"font-provider", OPT_CHOICE(font_provider,

View File

@ -153,8 +153,8 @@ struct osd_style_opts {
int align_x; int align_x;
int align_y; int align_y;
float blur; float blur;
int bold; bool bold;
int italic; bool italic;
int justify; int justify;
int font_provider; int font_provider;
}; };

View File

@ -70,17 +70,17 @@ static int hwdec_opt_help(struct mp_log *log, const m_option_t *opt,
#define OPT_BASE_STRUCT struct vd_lavc_params #define OPT_BASE_STRUCT struct vd_lavc_params
struct vd_lavc_params { struct vd_lavc_params {
int fast; bool fast;
int film_grain; int film_grain;
int show_all; bool show_all;
int skip_loop_filter; int skip_loop_filter;
int skip_idct; int skip_idct;
int skip_frame; int skip_frame;
int framedrop; int framedrop;
int threads; int threads;
int bitexact; bool bitexact;
int old_x264; bool old_x264;
int check_hw_profile; bool check_hw_profile;
int software_fallback; int software_fallback;
char **avopts; char **avopts;
int dr; int dr;
@ -103,18 +103,18 @@ static const struct m_opt_choice_alternatives discard_names[] = {
const struct m_sub_options vd_lavc_conf = { const struct m_sub_options vd_lavc_conf = {
.opts = (const m_option_t[]){ .opts = (const m_option_t[]){
{"vd-lavc-fast", OPT_FLAG(fast)}, {"vd-lavc-fast", OPT_BOOL(fast)},
{"vd-lavc-film-grain", OPT_CHOICE(film_grain, {"vd-lavc-film-grain", OPT_CHOICE(film_grain,
{"auto", -1}, {"cpu", 0}, {"gpu", 1})}, {"auto", -1}, {"cpu", 0}, {"gpu", 1})},
{"vd-lavc-show-all", OPT_FLAG(show_all)}, {"vd-lavc-show-all", OPT_BOOL(show_all)},
{"vd-lavc-skiploopfilter", OPT_DISCARD(skip_loop_filter)}, {"vd-lavc-skiploopfilter", OPT_DISCARD(skip_loop_filter)},
{"vd-lavc-skipidct", OPT_DISCARD(skip_idct)}, {"vd-lavc-skipidct", OPT_DISCARD(skip_idct)},
{"vd-lavc-skipframe", OPT_DISCARD(skip_frame)}, {"vd-lavc-skipframe", OPT_DISCARD(skip_frame)},
{"vd-lavc-framedrop", OPT_DISCARD(framedrop)}, {"vd-lavc-framedrop", OPT_DISCARD(framedrop)},
{"vd-lavc-threads", OPT_INT(threads), M_RANGE(0, DBL_MAX)}, {"vd-lavc-threads", OPT_INT(threads), M_RANGE(0, DBL_MAX)},
{"vd-lavc-bitexact", OPT_FLAG(bitexact)}, {"vd-lavc-bitexact", OPT_BOOL(bitexact)},
{"vd-lavc-assume-old-x264", OPT_FLAG(old_x264)}, {"vd-lavc-assume-old-x264", OPT_BOOL(old_x264)},
{"vd-lavc-check-hw-profile", OPT_FLAG(check_hw_profile)}, {"vd-lavc-check-hw-profile", OPT_BOOL(check_hw_profile)},
{"vd-lavc-software-fallback", OPT_CHOICE(software_fallback, {"vd-lavc-software-fallback", OPT_CHOICE(software_fallback,
{"no", INT_MAX}, {"yes", 1}), M_RANGE(1, INT_MAX)}, {"no", INT_MAX}, {"yes", 1}), M_RANGE(1, INT_MAX)},
{"vd-lavc-o", OPT_KEYVALUELIST(avopts)}, {"vd-lavc-o", OPT_KEYVALUELIST(avopts)},
@ -131,8 +131,7 @@ const struct m_sub_options vd_lavc_conf = {
.size = sizeof(struct vd_lavc_params), .size = sizeof(struct vd_lavc_params),
.defaults = &(const struct vd_lavc_params){ .defaults = &(const struct vd_lavc_params){
.film_grain = -1 /*auto*/, .film_grain = -1 /*auto*/,
.show_all = 0, .check_hw_profile = true,
.check_hw_profile = 1,
.software_fallback = 3, .software_fallback = 3,
.skip_loop_filter = AVDISCARD_DEFAULT, .skip_loop_filter = AVDISCARD_DEFAULT,
.skip_idct = AVDISCARD_DEFAULT, .skip_idct = AVDISCARD_DEFAULT,

View File

@ -43,8 +43,8 @@
#define D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION 0x20 #define D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION 0x20
struct opts { struct opts {
int deint_enabled; bool deint_enabled;
int interlaced_only; bool interlaced_only;
int mode; int mode;
}; };
@ -429,7 +429,6 @@ static struct mp_filter *vf_d3d11vpp_create(struct mp_filter *parent,
struct hwdec_imgfmt_request params = { struct hwdec_imgfmt_request params = {
.imgfmt = IMGFMT_D3D11, .imgfmt = IMGFMT_D3D11,
.probing = false,
}; };
hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params); hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params);
@ -479,8 +478,8 @@ fail:
#define OPT_BASE_STRUCT struct opts #define OPT_BASE_STRUCT struct opts
static const m_option_t vf_opts_fields[] = { static const m_option_t vf_opts_fields[] = {
{"deint", OPT_FLAG(deint_enabled)}, {"deint", OPT_BOOL(deint_enabled)},
{"interlaced-only", OPT_FLAG(interlaced_only)}, {"interlaced-only", OPT_BOOL(interlaced_only)},
{"mode", OPT_CHOICE(mode, {"mode", OPT_CHOICE(mode,
{"blend", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND}, {"blend", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND},
{"bob", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB}, {"bob", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB},
@ -497,8 +496,7 @@ const struct mp_user_filter_entry vf_d3d11vpp = {
.name = "d3d11vpp", .name = "d3d11vpp",
.priv_size = sizeof(OPT_BASE_STRUCT), .priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT) { .priv_defaults = &(const OPT_BASE_STRUCT) {
.deint_enabled = 1, .deint_enabled = true,
.interlaced_only = 0,
.mode = D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB, .mode = D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB,
}, },
.options = vf_opts_fields, .options = vf_opts_fields,

View File

@ -33,8 +33,8 @@
struct f_opts { struct f_opts {
int type; int type;
int clear; bool clear;
int print; bool print;
}; };
const struct m_opt_choice_alternatives type_names[] = { const struct m_opt_choice_alternatives type_names[] = {
@ -46,14 +46,14 @@ const struct m_opt_choice_alternatives type_names[] = {
#define OPT_BASE_STRUCT struct f_opts #define OPT_BASE_STRUCT struct f_opts
static const struct m_option f_opts_list[] = { static const struct m_option f_opts_list[] = {
{"type", OPT_CHOICE_C(type, type_names)}, {"type", OPT_CHOICE_C(type, type_names)},
{"clear-on-query", OPT_FLAG(clear)}, {"clear-on-query", OPT_BOOL(clear)},
{"print", OPT_FLAG(print)}, {"print", OPT_BOOL(print)},
{0} {0}
}; };
static const struct f_opts f_opts_def = { static const struct f_opts f_opts_def = {
.type = 16, .type = 16,
.clear = 1, .clear = true,
}; };
struct print_entry { struct print_entry {
@ -212,7 +212,7 @@ static struct mp_filter *f_create(struct mp_filter *parent, void *options)
.scaler_chroma_params = {NAN, NAN}, .scaler_chroma_params = {NAN, NAN},
.scaler_chroma = ZIMG_RESIZE_BILINEAR, .scaler_chroma = ZIMG_RESIZE_BILINEAR,
.dither = ZIMG_DITHER_NONE, .dither = ZIMG_DITHER_NONE,
.fast = 1, .fast = true,
}; };
return f; return f;
} }

View File

@ -55,10 +55,10 @@ struct vf_format_opts {
int w, h; int w, h;
int dw, dh; int dw, dh;
double dar; double dar;
int convert; bool convert;
int force_scaler; int force_scaler;
int dovi; bool dovi;
int film_grain; bool film_grain;
}; };
static void set_params(struct vf_format_opts *p, struct mp_image_params *out, static void set_params(struct vf_format_opts *p, struct mp_image_params *out,
@ -219,9 +219,9 @@ static const m_option_t vf_opts_fields[] = {
{"dw", OPT_INT(dw)}, {"dw", OPT_INT(dw)},
{"dh", OPT_INT(dh)}, {"dh", OPT_INT(dh)},
{"dar", OPT_DOUBLE(dar)}, {"dar", OPT_DOUBLE(dar)},
{"convert", OPT_FLAG(convert)}, {"convert", OPT_BOOL(convert)},
{"dolbyvision", OPT_FLAG(dovi)}, {"dolbyvision", OPT_BOOL(dovi)},
{"film-grain", OPT_FLAG(film_grain)}, {"film-grain", OPT_BOOL(film_grain)},
{"force-scaler", OPT_CHOICE(force_scaler, {"force-scaler", OPT_CHOICE(force_scaler,
{"auto", MP_SWS_AUTO}, {"auto", MP_SWS_AUTO},
{"sws", MP_SWS_SWS}, {"sws", MP_SWS_SWS},
@ -238,8 +238,8 @@ const struct mp_user_filter_entry vf_format = {
.priv_size = sizeof(OPT_BASE_STRUCT), .priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT){ .priv_defaults = &(const OPT_BASE_STRUCT){
.rotate = -1, .rotate = -1,
.dovi = 1, .dovi = true,
.film_grain = 1, .film_grain = true,
}, },
.options = vf_opts_fields, .options = vf_opts_fields,
}, },

View File

@ -51,8 +51,8 @@ struct pipeline {
struct opts { struct opts {
int deint_type; int deint_type;
int interlaced_only; bool interlaced_only;
int reversal_bug; bool reversal_bug;
}; };
struct priv { struct priv {
@ -482,8 +482,8 @@ static const m_option_t vf_opts_fields[] = {
{"weave", 3}, {"weave", 3},
{"motion-adaptive", 4}, {"motion-adaptive", 4},
{"motion-compensated", 5})}, {"motion-compensated", 5})},
{"interlaced-only", OPT_FLAG(interlaced_only)}, {"interlaced-only", OPT_BOOL(interlaced_only)},
{"reversal-bug", OPT_FLAG(reversal_bug)}, {"reversal-bug", OPT_BOOL(reversal_bug)},
{0} {0}
}; };
@ -494,8 +494,7 @@ const struct mp_user_filter_entry vf_vavpp = {
.priv_size = sizeof(OPT_BASE_STRUCT), .priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT){ .priv_defaults = &(const OPT_BASE_STRUCT){
.deint_type = -1, .deint_type = -1,
.interlaced_only = 0, .reversal_bug = true,
.reversal_bug = 1,
}, },
.options = vf_opts_fields, .options = vf_opts_fields,
}, },

View File

@ -41,8 +41,8 @@
// processing on the final rendering process in the VO. // processing on the final rendering process in the VO.
struct opts { struct opts {
int deint_enabled; bool deint_enabled;
int interlaced_only; bool interlaced_only;
struct mp_vdpau_mixer_opts opts; struct mp_vdpau_mixer_opts opts;
}; };
@ -174,13 +174,13 @@ static const m_option_t vf_opts_fields[] = {
{"temporal", 3}, {"temporal", 3},
{"temporal-spatial", 4}), {"temporal-spatial", 4}),
OPTDEF_INT(3)}, OPTDEF_INT(3)},
{"deint", OPT_FLAG(deint_enabled)}, {"deint", OPT_BOOL(deint_enabled)},
{"chroma-deint", OPT_FLAG(opts.chroma_deint), OPTDEF_INT(1)}, {"chroma-deint", OPT_BOOL(opts.chroma_deint), OPTDEF_INT(1)},
{"pullup", OPT_FLAG(opts.pullup)}, {"pullup", OPT_BOOL(opts.pullup)},
{"denoise", OPT_FLOAT(opts.denoise), M_RANGE(0, 1)}, {"denoise", OPT_FLOAT(opts.denoise), M_RANGE(0, 1)},
{"sharpen", OPT_FLOAT(opts.sharpen), M_RANGE(-1, 1)}, {"sharpen", OPT_FLOAT(opts.sharpen), M_RANGE(-1, 1)},
{"hqscaling", OPT_INT(opts.hqscaling), M_RANGE(0, 9)}, {"hqscaling", OPT_INT(opts.hqscaling), M_RANGE(0, 9)},
{"interlaced-only", OPT_FLAG(interlaced_only)}, {"interlaced-only", OPT_BOOL(interlaced_only)},
{0} {0}
}; };

View File

@ -43,17 +43,16 @@
const struct image_writer_opts image_writer_opts_defaults = { const struct image_writer_opts image_writer_opts_defaults = {
.format = AV_CODEC_ID_MJPEG, .format = AV_CODEC_ID_MJPEG,
.high_bit_depth = 1, .high_bit_depth = true,
.png_compression = 7, .png_compression = 7,
.png_filter = 5, .png_filter = 5,
.jpeg_quality = 90, .jpeg_quality = 90,
.jpeg_source_chroma = 1, .jpeg_source_chroma = true,
.webp_lossless = 0,
.webp_quality = 75, .webp_quality = 75,
.webp_compression = 4, .webp_compression = 4,
.jxl_distance = 1.0, .jxl_distance = 1.0,
.jxl_effort = 4, .jxl_effort = 4,
.tag_csp = 1, .tag_csp = true,
}; };
const struct m_opt_choice_alternatives mp_image_writer_formats[] = { const struct m_opt_choice_alternatives mp_image_writer_formats[] = {
@ -72,18 +71,18 @@ const struct m_opt_choice_alternatives mp_image_writer_formats[] = {
const struct m_option image_writer_opts[] = { const struct m_option image_writer_opts[] = {
{"format", OPT_CHOICE_C(format, mp_image_writer_formats)}, {"format", OPT_CHOICE_C(format, mp_image_writer_formats)},
{"jpeg-quality", OPT_INT(jpeg_quality), M_RANGE(0, 100)}, {"jpeg-quality", OPT_INT(jpeg_quality), M_RANGE(0, 100)},
{"jpeg-source-chroma", OPT_FLAG(jpeg_source_chroma)}, {"jpeg-source-chroma", OPT_BOOL(jpeg_source_chroma)},
{"png-compression", OPT_INT(png_compression), M_RANGE(0, 9)}, {"png-compression", OPT_INT(png_compression), M_RANGE(0, 9)},
{"png-filter", OPT_INT(png_filter), M_RANGE(0, 5)}, {"png-filter", OPT_INT(png_filter), M_RANGE(0, 5)},
{"webp-lossless", OPT_FLAG(webp_lossless)}, {"webp-lossless", OPT_BOOL(webp_lossless)},
{"webp-quality", OPT_INT(webp_quality), M_RANGE(0, 100)}, {"webp-quality", OPT_INT(webp_quality), M_RANGE(0, 100)},
{"webp-compression", OPT_INT(webp_compression), M_RANGE(0, 6)}, {"webp-compression", OPT_INT(webp_compression), M_RANGE(0, 6)},
#if HAVE_JPEGXL #if HAVE_JPEGXL
{"jxl-distance", OPT_DOUBLE(jxl_distance), M_RANGE(0.0, 15.0)}, {"jxl-distance", OPT_DOUBLE(jxl_distance), M_RANGE(0.0, 15.0)},
{"jxl-effort", OPT_INT(jxl_effort), M_RANGE(1, 9)}, {"jxl-effort", OPT_INT(jxl_effort), M_RANGE(1, 9)},
#endif #endif
{"high-bit-depth", OPT_FLAG(high_bit_depth)}, {"high-bit-depth", OPT_BOOL(high_bit_depth)},
{"tag-colorspace", OPT_FLAG(tag_csp)}, {"tag-colorspace", OPT_BOOL(tag_csp)},
{0}, {0},
}; };

View File

@ -22,7 +22,7 @@ struct mp_log;
struct image_writer_opts { struct image_writer_opts {
int format; int format;
int high_bit_depth; bool high_bit_depth;
int png_compression; int png_compression;
int png_filter; int png_filter;
int jpeg_quality; int jpeg_quality;
@ -31,13 +31,13 @@ struct image_writer_opts {
int jpeg_dpi; int jpeg_dpi;
int jpeg_progressive; int jpeg_progressive;
int jpeg_baseline; int jpeg_baseline;
int jpeg_source_chroma; bool jpeg_source_chroma;
int webp_lossless; bool webp_lossless;
int webp_quality; int webp_quality;
int webp_compression; int webp_compression;
double jxl_distance; double jxl_distance;
int jxl_effort; int jxl_effort;
int tag_csp; bool tag_csp;
}; };
extern const struct image_writer_opts image_writer_opts_defaults; extern const struct image_writer_opts image_writer_opts_defaults;

View File

@ -202,7 +202,7 @@ class CocoaCB: Common {
func shutdown(_ destroy: Bool = false) { func shutdown(_ destroy: Bool = false) {
isShuttingDown = window?.isAnimating ?? false || isShuttingDown = window?.isAnimating ?? false ||
window?.isInFullscreen ?? false && Bool(mpv?.opts.native_fs ?? 1) window?.isInFullscreen ?? false && mpv?.opts.native_fs ?? true
if window?.isInFullscreen ?? false && !(window?.isAnimating ?? false) { if window?.isInFullscreen ?? false && !(window?.isAnimating ?? false) {
window?.close() window?.close()
} }

View File

@ -34,12 +34,12 @@ static int d3d11_validate_adapter(struct mp_log *log,
struct d3d11_opts { struct d3d11_opts {
int feature_level; int feature_level;
int warp; int warp;
int flip; bool flip;
int sync_interval; int sync_interval;
char *adapter_name; char *adapter_name;
int output_format; int output_format;
int color_space; int color_space;
int exclusive_fs; bool exclusive_fs;
}; };
#define OPT_BASE_STRUCT struct d3d11_opts #define OPT_BASE_STRUCT struct d3d11_opts
@ -59,7 +59,7 @@ const struct m_sub_options d3d11_conf = {
{"9_3", D3D_FEATURE_LEVEL_9_3}, {"9_3", D3D_FEATURE_LEVEL_9_3},
{"9_2", D3D_FEATURE_LEVEL_9_2}, {"9_2", D3D_FEATURE_LEVEL_9_2},
{"9_1", D3D_FEATURE_LEVEL_9_1})}, {"9_1", D3D_FEATURE_LEVEL_9_1})},
{"d3d11-flip", OPT_FLAG(flip)}, {"d3d11-flip", OPT_BOOL(flip)},
{"d3d11-sync-interval", OPT_INT(sync_interval), M_RANGE(0, 4)}, {"d3d11-sync-interval", OPT_INT(sync_interval), M_RANGE(0, 4)},
{"d3d11-adapter", OPT_STRING_VALIDATE(adapter_name, {"d3d11-adapter", OPT_STRING_VALIDATE(adapter_name,
d3d11_validate_adapter)}, d3d11_validate_adapter)},
@ -75,18 +75,17 @@ const struct m_sub_options d3d11_conf = {
{"linear", DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709}, {"linear", DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709},
{"pq", DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020}, {"pq", DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020},
{"bt.2020", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020})}, {"bt.2020", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020})},
{"d3d11-exclusive-fs", OPT_FLAG(exclusive_fs)}, {"d3d11-exclusive-fs", OPT_BOOL(exclusive_fs)},
{0} {0}
}, },
.defaults = &(const struct d3d11_opts) { .defaults = &(const struct d3d11_opts) {
.feature_level = D3D_FEATURE_LEVEL_12_1, .feature_level = D3D_FEATURE_LEVEL_12_1,
.warp = -1, .warp = -1,
.flip = 1, .flip = true,
.sync_interval = 1, .sync_interval = 1,
.adapter_name = NULL, .adapter_name = NULL,
.output_format = DXGI_FORMAT_UNKNOWN, .output_format = DXGI_FORMAT_UNKNOWN,
.color_space = -1, .color_space = -1,
.exclusive_fs = 0,
}, },
.size = sizeof(struct d3d11_opts) .size = sizeof(struct d3d11_opts)
}; };
@ -222,7 +221,6 @@ static bool d3d11_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
*out_fbo = (struct ra_fbo) { *out_fbo = (struct ra_fbo) {
.tex = p->backbuffer, .tex = p->backbuffer,
.flip = false,
.color_space = p->swapchain_csp .color_space = p->swapchain_csp
}; };
return true; return true;

View File

@ -28,17 +28,16 @@
#include "video/out/gpu/hwdec.h" #include "video/out/gpu/hwdec.h"
struct d3d11va_opts { struct d3d11va_opts {
int zero_copy; bool zero_copy;
}; };
#define OPT_BASE_STRUCT struct d3d11va_opts #define OPT_BASE_STRUCT struct d3d11va_opts
const struct m_sub_options d3d11va_conf = { const struct m_sub_options d3d11va_conf = {
.opts = (const struct m_option[]) { .opts = (const struct m_option[]) {
{"d3d11va-zero-copy", OPT_FLAG(zero_copy)}, {"d3d11va-zero-copy", OPT_BOOL(zero_copy)},
{0} {0}
}, },
.defaults = &(const struct d3d11va_opts) { .defaults = &(const struct d3d11va_opts) {
.zero_copy = 0,
}, },
.size = sizeof(struct d3d11va_opts) .size = sizeof(struct d3d11va_opts)
}; };

View File

@ -269,8 +269,8 @@ const struct m_sub_options ra_ctx_conf = {
{"gpu-api", {"gpu-api",
OPT_STRING_VALIDATE(context_type, ra_ctx_validate_api), OPT_STRING_VALIDATE(context_type, ra_ctx_validate_api),
.help = ra_ctx_api_help}, .help = ra_ctx_api_help},
{"gpu-debug", OPT_FLAG(debug)}, {"gpu-debug", OPT_BOOL(debug)},
{"gpu-sw", OPT_FLAG(allow_sw)}, {"gpu-sw", OPT_BOOL(allow_sw)},
{0} {0}
}, },
.size = sizeof(struct ra_ctx_opts), .size = sizeof(struct ra_ctx_opts),

View File

@ -6,9 +6,9 @@
#include "ra.h" #include "ra.h"
struct ra_ctx_opts { struct ra_ctx_opts {
int allow_sw; // allow software renderers bool allow_sw; // allow software renderers
int want_alpha; // create an alpha framebuffer if possible int want_alpha; // create an alpha framebuffer if possible
int debug; // enable debugging layers/callbacks etc. bool debug; // enable debugging layers/callbacks etc.
bool probing; // the backend was auto-probed bool probing; // the backend was auto-probed
char *context_name; // filter by `ra_ctx_fns.name` char *context_name; // filter by `ra_ctx_fns.name`
char *context_type; // filter by `ra_ctx_fns.type` char *context_type; // filter by `ra_ctx_fns.type`

View File

@ -491,9 +491,9 @@ static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt,
#define OPT_BASE_STRUCT struct mp_icc_opts #define OPT_BASE_STRUCT struct mp_icc_opts
const struct m_sub_options mp_icc_conf = { const struct m_sub_options mp_icc_conf = {
.opts = (const m_option_t[]) { .opts = (const m_option_t[]) {
{"use-embedded-icc-profile", OPT_FLAG(use_embedded)}, {"use-embedded-icc-profile", OPT_BOOL(use_embedded)},
{"icc-profile", OPT_STRING(profile), .flags = M_OPT_FILE}, {"icc-profile", OPT_STRING(profile), .flags = M_OPT_FILE},
{"icc-profile-auto", OPT_FLAG(profile_auto)}, {"icc-profile-auto", OPT_BOOL(profile_auto)},
{"icc-cache-dir", OPT_STRING(cache_dir), .flags = M_OPT_FILE}, {"icc-cache-dir", OPT_STRING(cache_dir), .flags = M_OPT_FILE},
{"icc-intent", OPT_INT(intent)}, {"icc-intent", OPT_INT(intent)},
{"icc-force-contrast", OPT_CHOICE(contrast, {"no", 0}, {"inf", -1}), {"icc-force-contrast", OPT_CHOICE(contrast, {"no", 0}, {"inf", -1}),

View File

@ -10,9 +10,9 @@
extern const struct m_sub_options mp_icc_conf; extern const struct m_sub_options mp_icc_conf;
struct mp_icc_opts { struct mp_icc_opts {
int use_embedded; bool use_embedded;
char *profile; char *profile;
int profile_auto; bool profile_auto;
char *cache_dir; char *cache_dir;
char *size_str; char *size_str;
int intent; int intent;

View File

@ -170,7 +170,6 @@ static bool parse_hook(struct mp_log *log, struct bstr *body,
*out = (struct gl_user_shader_hook){ *out = (struct gl_user_shader_hook){
.pass_desc = bstr0("(unknown)"), .pass_desc = bstr0("(unknown)"),
.offset = identity_trans, .offset = identity_trans,
.align_offset = false,
.width = {{ SZEXP_VAR_W, { .varname = bstr0("HOOKED") }}}, .width = {{ SZEXP_VAR_W, { .varname = bstr0("HOOKED") }}},
.height = {{ SZEXP_VAR_H, { .varname = bstr0("HOOKED") }}}, .height = {{ SZEXP_VAR_H, { .varname = bstr0("HOOKED") }}},
.cond = {{ SZEXP_CONST, { .cval = 1.0 }}}, .cond = {{ SZEXP_CONST, { .cval = 1.0 }}},

View File

@ -25,6 +25,7 @@
#include <libavutil/common.h> #include <libavutil/common.h>
#include <libavutil/lfg.h> #include <libavutil/lfg.h>
#include "options/m_option.h"
#include "video.h" #include "video.h"
#include "misc/bstr.h" #include "misc/bstr.h"
@ -312,7 +313,7 @@ static const struct gl_video_opts gl_video_opts_def = {
{{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}}, {{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}},
.clamp = 1, }, // tscale .clamp = 1, }, // tscale
}, },
.scaler_resizes_only = 1, .scaler_resizes_only = true,
.scaler_lut_size = 6, .scaler_lut_size = 6,
.interpolation_threshold = 0.01, .interpolation_threshold = 0.01,
.alpha_mode = ALPHA_BLEND_TILES, .alpha_mode = ALPHA_BLEND_TILES,
@ -368,7 +369,7 @@ const struct m_sub_options gl_video_conf = {
{"auto", 0}, {"yes", 1}, {"no", -1})}, {"auto", 0}, {"yes", 1}, {"no", -1})},
{"gamma-factor", OPT_FLOAT(gamma), M_RANGE(0.1, 2.0), {"gamma-factor", OPT_FLOAT(gamma), M_RANGE(0.1, 2.0),
.deprecation_message = "no replacement"}, .deprecation_message = "no replacement"},
{"gamma-auto", OPT_FLAG(gamma_auto), {"gamma-auto", OPT_BOOL(gamma_auto),
.deprecation_message = "no replacement"}, .deprecation_message = "no replacement"},
{"target-prim", OPT_CHOICE_C(target_prim, mp_csp_prim_names)}, {"target-prim", OPT_CHOICE_C(target_prim, mp_csp_prim_names)},
{"target-trc", OPT_CHOICE_C(target_trc, mp_csp_trc_names)}, {"target-trc", OPT_CHOICE_C(target_trc, mp_csp_trc_names)},
@ -388,7 +389,7 @@ const struct m_sub_options gl_video_conf = {
{"st2094-40", TONE_MAPPING_ST2094_40}, {"st2094-40", TONE_MAPPING_ST2094_40},
{"st2094-10", TONE_MAPPING_ST2094_10})}, {"st2094-10", TONE_MAPPING_ST2094_10})},
{"tone-mapping-param", OPT_FLOATDEF(tone_map.curve_param)}, {"tone-mapping-param", OPT_FLOATDEF(tone_map.curve_param)},
{"inverse-tone-mapping", OPT_FLAG(tone_map.inverse)}, {"inverse-tone-mapping", OPT_BOOL(tone_map.inverse)},
{"tone-mapping-crosstalk", OPT_FLOAT(tone_map.crosstalk), {"tone-mapping-crosstalk", OPT_FLOAT(tone_map.crosstalk),
M_RANGE(0.0, 0.3)}, M_RANGE(0.0, 0.3)},
{"tone-mapping-max-boost", OPT_FLOAT(tone_map.max_boost), {"tone-mapping-max-boost", OPT_FLOAT(tone_map.max_boost),
@ -399,7 +400,7 @@ const struct m_sub_options gl_video_conf = {
{"max", TONE_MAP_MODE_MAX}, {"max", TONE_MAP_MODE_MAX},
{"hybrid", TONE_MAP_MODE_HYBRID}, {"hybrid", TONE_MAP_MODE_HYBRID},
{"luma", TONE_MAP_MODE_LUMA})}, {"luma", TONE_MAP_MODE_LUMA})},
{"tone-mapping-visualize", OPT_FLAG(tone_map.visualize)}, {"tone-mapping-visualize", OPT_BOOL(tone_map.visualize)},
{"gamut-mapping-mode", OPT_CHOICE(tone_map.gamut_mode, {"gamut-mapping-mode", OPT_CHOICE(tone_map.gamut_mode,
{"auto", GAMUT_AUTO}, {"auto", GAMUT_AUTO},
{"clip", GAMUT_CLIP}, {"clip", GAMUT_CLIP},
@ -416,17 +417,17 @@ const struct m_sub_options gl_video_conf = {
M_RANGE(0, 20.0)}, M_RANGE(0, 20.0)},
{"hdr-scene-threshold-high", OPT_FLOAT(tone_map.scene_threshold_high), {"hdr-scene-threshold-high", OPT_FLOAT(tone_map.scene_threshold_high),
M_RANGE(0, 20.0)}, M_RANGE(0, 20.0)},
{"opengl-pbo", OPT_FLAG(pbo)}, {"opengl-pbo", OPT_BOOL(pbo)},
SCALER_OPTS("scale", SCALER_SCALE), SCALER_OPTS("scale", SCALER_SCALE),
SCALER_OPTS("dscale", SCALER_DSCALE), SCALER_OPTS("dscale", SCALER_DSCALE),
SCALER_OPTS("cscale", SCALER_CSCALE), SCALER_OPTS("cscale", SCALER_CSCALE),
SCALER_OPTS("tscale", SCALER_TSCALE), SCALER_OPTS("tscale", SCALER_TSCALE),
{"scaler-lut-size", OPT_INT(scaler_lut_size), M_RANGE(4, 10)}, {"scaler-lut-size", OPT_INT(scaler_lut_size), M_RANGE(4, 10)},
{"scaler-resizes-only", OPT_FLAG(scaler_resizes_only)}, {"scaler-resizes-only", OPT_BOOL(scaler_resizes_only)},
{"correct-downscaling", OPT_FLAG(correct_downscaling)}, {"correct-downscaling", OPT_BOOL(correct_downscaling)},
{"linear-downscaling", OPT_FLAG(linear_downscaling)}, {"linear-downscaling", OPT_BOOL(linear_downscaling)},
{"linear-upscaling", OPT_FLAG(linear_upscaling)}, {"linear-upscaling", OPT_BOOL(linear_upscaling)},
{"sigmoid-upscaling", OPT_FLAG(sigmoid_upscaling)}, {"sigmoid-upscaling", OPT_BOOL(sigmoid_upscaling)},
{"sigmoid-center", OPT_FLOAT(sigmoid_center), M_RANGE(0.0, 1.0)}, {"sigmoid-center", OPT_FLOAT(sigmoid_center), M_RANGE(0.0, 1.0)},
{"sigmoid-slope", OPT_FLOAT(sigmoid_slope), M_RANGE(1.0, 20.0)}, {"sigmoid-slope", OPT_FLOAT(sigmoid_slope), M_RANGE(1.0, 20.0)},
{"fbo-format", OPT_STRING(fbo_format)}, {"fbo-format", OPT_STRING(fbo_format)},
@ -438,7 +439,7 @@ const struct m_sub_options gl_video_conf = {
{"error-diffusion", DITHER_ERROR_DIFFUSION}, {"error-diffusion", DITHER_ERROR_DIFFUSION},
{"no", DITHER_NONE})}, {"no", DITHER_NONE})},
{"dither-size-fruit", OPT_INT(dither_size), M_RANGE(2, 8)}, {"dither-size-fruit", OPT_INT(dither_size), M_RANGE(2, 8)},
{"temporal-dither", OPT_FLAG(temporal_dither)}, {"temporal-dither", OPT_BOOL(temporal_dither)},
{"temporal-dither-period", OPT_INT(temporal_dither_period), {"temporal-dither-period", OPT_INT(temporal_dither_period),
M_RANGE(1, 128)}, M_RANGE(1, 128)},
{"error-diffusion", {"error-diffusion",
@ -448,9 +449,9 @@ const struct m_sub_options gl_video_conf = {
{"yes", ALPHA_YES}, {"yes", ALPHA_YES},
{"blend", ALPHA_BLEND}, {"blend", ALPHA_BLEND},
{"blend-tiles", ALPHA_BLEND_TILES})}, {"blend-tiles", ALPHA_BLEND_TILES})},
{"opengl-rectangle-textures", OPT_FLAG(use_rectangle)}, {"opengl-rectangle-textures", OPT_BOOL(use_rectangle)},
{"background", OPT_COLOR(background)}, {"background", OPT_COLOR(background)},
{"interpolation", OPT_FLAG(interpolation)}, {"interpolation", OPT_BOOL(interpolation)},
{"interpolation-threshold", OPT_FLOAT(interpolation_threshold)}, {"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
{"blend-subtitles", OPT_CHOICE(blend_subs, {"blend-subtitles", OPT_CHOICE(blend_subs,
{"no", BLEND_SUBS_NO}, {"no", BLEND_SUBS_NO},
@ -459,7 +460,7 @@ const struct m_sub_options gl_video_conf = {
{"glsl-shaders", OPT_PATHLIST(user_shaders), .flags = M_OPT_FILE}, {"glsl-shaders", OPT_PATHLIST(user_shaders), .flags = M_OPT_FILE},
{"glsl-shader", OPT_CLI_ALIAS("glsl-shaders-append")}, {"glsl-shader", OPT_CLI_ALIAS("glsl-shaders-append")},
{"glsl-shader-opts", OPT_KEYVALUELIST(user_shader_opts)}, {"glsl-shader-opts", OPT_KEYVALUELIST(user_shader_opts)},
{"deband", OPT_FLAG(deband)}, {"deband", OPT_BOOL(deband)},
{"deband", OPT_SUBSTRUCT(deband_opts, deband_conf)}, {"deband", OPT_SUBSTRUCT(deband_opts, deband_conf)},
{"sharpen", OPT_FLOAT(unsharp)}, {"sharpen", OPT_FLOAT(unsharp)},
{"gpu-tex-pad-x", OPT_INT(tex_pad_x), M_RANGE(0, 4096)}, {"gpu-tex-pad-x", OPT_INT(tex_pad_x), M_RANGE(0, 4096)},
@ -3876,7 +3877,7 @@ static void check_gl_features(struct gl_video *p)
// p->opts is a copy => we can just mess with it. // p->opts is a copy => we can just mess with it.
p->opts.scaler[n].kernel.name = "bilinear"; p->opts.scaler[n].kernel.name = "bilinear";
if (n == SCALER_TSCALE) if (n == SCALER_TSCALE)
p->opts.interpolation = 0; p->opts.interpolation = false;
} }
} }
} }
@ -3900,7 +3901,7 @@ static void check_gl_features(struct gl_video *p)
MP_WARN(p, "Disabling color management (GLSL version too old).\n"); MP_WARN(p, "Disabling color management (GLSL version too old).\n");
} }
if (!have_mglsl && p->opts.deband) { if (!have_mglsl && p->opts.deband) {
p->opts.deband = 0; p->opts.deband = false;
MP_WARN(p, "Disabling debanding (GLSL version too old).\n"); MP_WARN(p, "Disabling debanding (GLSL version too old).\n");
} }
} }

View File

@ -122,7 +122,7 @@ struct gl_tone_map_opts {
int curve; int curve;
float curve_param; float curve_param;
float max_boost; float max_boost;
int inverse; bool inverse;
float crosstalk; float crosstalk;
int mode; int mode;
int compute_peak; int compute_peak;
@ -130,7 +130,7 @@ struct gl_tone_map_opts {
float scene_threshold_low; float scene_threshold_low;
float scene_threshold_high; float scene_threshold_high;
int gamut_mode; int gamut_mode;
int visualize; bool visualize;
}; };
struct gl_video_opts { struct gl_video_opts {
@ -138,35 +138,35 @@ struct gl_video_opts {
struct scaler_config scaler[4]; struct scaler_config scaler[4];
int scaler_lut_size; int scaler_lut_size;
float gamma; float gamma;
int gamma_auto; bool gamma_auto;
int target_prim; int target_prim;
int target_trc; int target_trc;
int target_peak; int target_peak;
struct gl_tone_map_opts tone_map; struct gl_tone_map_opts tone_map;
int correct_downscaling; bool correct_downscaling;
int linear_downscaling; bool linear_downscaling;
int linear_upscaling; bool linear_upscaling;
int sigmoid_upscaling; bool sigmoid_upscaling;
float sigmoid_center; float sigmoid_center;
float sigmoid_slope; float sigmoid_slope;
int scaler_resizes_only; bool scaler_resizes_only;
int pbo; bool pbo;
int dither_depth; int dither_depth;
int dither_algo; int dither_algo;
int dither_size; int dither_size;
int temporal_dither; bool temporal_dither;
int temporal_dither_period; int temporal_dither_period;
char *error_diffusion; char *error_diffusion;
char *fbo_format; char *fbo_format;
int alpha_mode; int alpha_mode;
int use_rectangle; bool use_rectangle;
struct m_color background; struct m_color background;
int interpolation; bool interpolation;
float interpolation_threshold; float interpolation_threshold;
int blend_subs; int blend_subs;
char **user_shaders; char **user_shaders;
char **user_shader_opts; char **user_shader_opts;
int deband; bool deband;
struct deband_opts *deband_opts; struct deband_opts *deband_opts;
float unsharp; float unsharp;
int tex_pad_x, tex_pad_y; int tex_pad_x, tex_pad_y;

View File

@ -633,7 +633,7 @@ class Common: NSObject {
let size = UnsafeBufferPointer(start: sizeData, count: 2) let size = UnsafeBufferPointer(start: sizeData, count: 2)
var rect = NSMakeRect(0, 0, CGFloat(size[0]), CGFloat(size[1])) var rect = NSMakeRect(0, 0, CGFloat(size[0]), CGFloat(size[1]))
DispatchQueue.main.async { DispatchQueue.main.async {
if let screen = self.window?.currentScreen, !Bool(self.mpv?.opts.hidpi_window_scale ?? 1) { if let screen = self.window?.currentScreen, !Bool(self.mpv?.opts.hidpi_window_scale ?? true) {
rect = screen.convertRectFromBacking(rect) rect = screen.convertRectFromBacking(rect)
} }
self.window?.updateSize(rect.size) self.window?.updateSize(rect.size)

View File

@ -269,12 +269,12 @@ class GLLayer: CAOpenGLLayer {
glBase.insert(CGLPixelFormatAttribute(ver.rawValue), at: 1) glBase.insert(CGLPixelFormatAttribute(ver.rawValue), at: 1)
var glFormat = [glBase] var glFormat = [glBase]
if (ccb.libmpv.macOpts.cocoa_cb_10bit_context == 1) { if ccb.libmpv.macOpts.cocoa_cb_10bit_context {
glFormat += [glFormat10Bit] glFormat += [glFormat10Bit]
} }
glFormat += glFormatOptional glFormat += glFormatOptional
if (ccb.libmpv.macOpts.macos_force_dedicated_gpu == 0) { if !ccb.libmpv.macOpts.macos_force_dedicated_gpu {
glFormat += [glFormatAutoGPU] glFormat += [glFormatAutoGPU]
} }

View File

@ -137,7 +137,7 @@ class Window: NSWindow, NSWindowDelegate {
setFrame(frame, display: true) setFrame(frame, display: true)
} }
if Bool(mpv?.opts.native_fs ?? 1) { if Bool(mpv?.opts.native_fs ?? true) {
super.toggleFullScreen(sender) super.toggleFullScreen(sender)
} else { } else {
if !isInFullscreen { if !isInFullscreen {

View File

@ -44,8 +44,8 @@ enum {
}; };
struct opengl_opts { struct opengl_opts {
int use_glfinish; bool use_glfinish;
int waitvsync; bool waitvsync;
int vsync_pattern[2]; int vsync_pattern[2];
int swapinterval; int swapinterval;
int early_flush; int early_flush;
@ -55,8 +55,8 @@ struct opengl_opts {
#define OPT_BASE_STRUCT struct opengl_opts #define OPT_BASE_STRUCT struct opengl_opts
const struct m_sub_options opengl_conf = { const struct m_sub_options opengl_conf = {
.opts = (const struct m_option[]) { .opts = (const struct m_option[]) {
{"opengl-glfinish", OPT_FLAG(use_glfinish)}, {"opengl-glfinish", OPT_BOOL(use_glfinish)},
{"opengl-waitvsync", OPT_FLAG(waitvsync)}, {"opengl-waitvsync", OPT_BOOL(waitvsync)},
{"opengl-swapinterval", OPT_INT(swapinterval)}, {"opengl-swapinterval", OPT_INT(swapinterval)},
{"opengl-check-pattern-a", OPT_INT(vsync_pattern[0])}, {"opengl-check-pattern-a", OPT_INT(vsync_pattern[0])},
{"opengl-check-pattern-b", OPT_INT(vsync_pattern[1])}, {"opengl-check-pattern-b", OPT_INT(vsync_pattern[1])},

View File

@ -53,7 +53,7 @@ struct angle_opts {
int d3d11_warp; int d3d11_warp;
int d3d11_feature_level; int d3d11_feature_level;
int egl_windowing; int egl_windowing;
int flip; bool flip;
}; };
#define OPT_BASE_STRUCT struct angle_opts #define OPT_BASE_STRUCT struct angle_opts
@ -76,7 +76,7 @@ const struct m_sub_options angle_conf = {
{"auto", -1}, {"auto", -1},
{"no", 0}, {"no", 0},
{"yes", 1})}, {"yes", 1})},
{"angle-flip", OPT_FLAG(flip)}, {"angle-flip", OPT_BOOL(flip)},
{"angle-max-frame-latency", OPT_REPLACED("swapchain-depth")}, {"angle-max-frame-latency", OPT_REPLACED("swapchain-depth")},
{"angle-swapchain-length", OPT_REMOVED("controlled by --swapchain-depth")}, {"angle-swapchain-length", OPT_REMOVED("controlled by --swapchain-depth")},
{0} {0}
@ -86,7 +86,7 @@ const struct m_sub_options angle_conf = {
.d3d11_warp = -1, .d3d11_warp = -1,
.d3d11_feature_level = D3D_FEATURE_LEVEL_11_0, .d3d11_feature_level = D3D_FEATURE_LEVEL_11_0,
.egl_windowing = -1, .egl_windowing = -1,
.flip = 1, .flip = true,
}, },
.size = sizeof(struct angle_opts), .size = sizeof(struct angle_opts),
}; };

View File

@ -36,7 +36,6 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
p->ra_ctx->log = ctx->log; p->ra_ctx->log = ctx->log;
p->ra_ctx->global = ctx->global; p->ra_ctx->global = ctx->global;
p->ra_ctx->opts = (struct ra_ctx_opts) { p->ra_ctx->opts = (struct ra_ctx_opts) {
.probing = false,
.allow_sw = true, .allow_sw = true,
}; };
@ -55,8 +54,8 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
if (!ra_gl_ctx_init(p->ra_ctx, p->gl, gl_params)) if (!ra_gl_ctx_init(p->ra_ctx, p->gl, gl_params))
return MPV_ERROR_UNSUPPORTED; return MPV_ERROR_UNSUPPORTED;
int debug; bool debug;
mp_read_option_raw(ctx->global, "gpu-debug", &m_option_type_flag, &debug); mp_read_option_raw(ctx->global, "gpu-debug", &m_option_type_bool, &debug);
p->ra_ctx->opts.debug = debug; p->ra_ctx->opts.debug = debug;
p->gl->debug_context = debug; p->gl->debug_context = debug;
ra_gl_set_debug(p->ra_ctx->ra, debug); ra_gl_set_debug(p->ra_ctx->ra, debug);

View File

@ -153,7 +153,6 @@ bool mppl_wrap_tex(struct ra *ra, pl_tex pltex, struct ra_tex *out_tex)
.downloadable = pltex->params.host_readable, .downloadable = pltex->params.host_readable,
// These don't exist upstream, so just pick something reasonable // These don't exist upstream, so just pick something reasonable
.src_linear = pltex->params.format->caps & PL_FMT_CAP_LINEAR, .src_linear = pltex->params.format->caps & PL_FMT_CAP_LINEAR,
.src_repeat = false,
}, },
.priv = (void *) pltex, .priv = (void *) pltex,
}; };

View File

@ -80,12 +80,12 @@ struct d3dtex {
typedef struct d3d_priv { typedef struct d3d_priv {
struct mp_log *log; struct mp_log *log;
int opt_disable_texture_align; bool opt_disable_texture_align;
// debugging // debugging
int opt_force_power_of_2; bool opt_force_power_of_2;
int opt_texture_memory; int opt_texture_memory;
int opt_swap_discard; bool opt_swap_discard;
int opt_exact_backbuffer; bool opt_exact_backbuffer;
struct vo *vo; struct vo *vo;
@ -1222,16 +1222,16 @@ static void draw_osd(struct vo *vo)
#define OPT_BASE_STRUCT d3d_priv #define OPT_BASE_STRUCT d3d_priv
static const struct m_option opts[] = { static const struct m_option opts[] = {
{"force-power-of-2", OPT_FLAG(opt_force_power_of_2)}, {"force-power-of-2", OPT_BOOL(opt_force_power_of_2)},
{"disable-texture-align", OPT_FLAG(opt_disable_texture_align)}, {"disable-texture-align", OPT_BOOL(opt_disable_texture_align)},
{"texture-memory", OPT_CHOICE(opt_texture_memory, {"texture-memory", OPT_CHOICE(opt_texture_memory,
{"default", 0}, {"default", 0},
{"managed", 1}, {"managed", 1},
{"default-pool", 2}, {"default-pool", 2},
{"default-pool-shadow", 3}, {"default-pool-shadow", 3},
{"scratch", 4})}, {"scratch", 4})},
{"swap-discard", OPT_FLAG(opt_swap_discard)}, {"swap-discard", OPT_BOOL(opt_swap_discard)},
{"exact-backbuffer", OPT_FLAG(opt_exact_backbuffer)}, {"exact-backbuffer", OPT_BOOL(opt_exact_backbuffer)},
{0} {0}
}; };

View File

@ -147,9 +147,9 @@ struct priv {
// Performance data of last frame // Performance data of last frame
struct voctrl_performance_data perf; struct voctrl_performance_data perf;
int delayed_peak; bool delayed_peak;
int inter_preserve; bool inter_preserve;
int target_hint; bool target_hint;
}; };
static void update_render_options(struct vo *vo); static void update_render_options(struct vo *vo);
@ -1961,14 +1961,14 @@ const struct vo_driver video_out_gpu_next = {
}, },
.options = (const struct m_option[]) { .options = (const struct m_option[]) {
{"allow-delayed-peak-detect", OPT_FLAG(delayed_peak)}, {"allow-delayed-peak-detect", OPT_BOOL(delayed_peak)},
{"interpolation-preserve", OPT_FLAG(inter_preserve)}, {"interpolation-preserve", OPT_BOOL(inter_preserve)},
{"lut", OPT_STRING(lut.opt), .flags = M_OPT_FILE}, {"lut", OPT_STRING(lut.opt), .flags = M_OPT_FILE},
{"lut-type", OPT_CHOICE_C(lut.type, lut_types)}, {"lut-type", OPT_CHOICE_C(lut.type, lut_types)},
{"image-lut", OPT_STRING(image_lut.opt), .flags = M_OPT_FILE}, {"image-lut", OPT_STRING(image_lut.opt), .flags = M_OPT_FILE},
{"image-lut-type", OPT_CHOICE_C(image_lut.type, lut_types)}, {"image-lut-type", OPT_CHOICE_C(image_lut.type, lut_types)},
{"target-lut", OPT_STRING(target_lut.opt), .flags = M_OPT_FILE}, {"target-lut", OPT_STRING(target_lut.opt), .flags = M_OPT_FILE},
{"target-colorspace-hint", OPT_FLAG(target_hint)}, {"target-colorspace-hint", OPT_BOOL(target_hint)},
// No `target-lut-type` because we don't support non-RGB targets // No `target-lut-type` because we don't support non-RGB targets
{0} {0}
}, },

View File

@ -79,8 +79,8 @@ static inline void write_str(const char *s)
struct vo_kitty_opts { struct vo_kitty_opts {
int width, height, top, left, rows, cols; int width, height, top, left, rows, cols;
int config_clear, alt_screen; bool config_clear, alt_screen;
int use_shm; bool use_shm;
}; };
struct priv { struct priv {
@ -414,8 +414,8 @@ const struct vo_driver video_out_kitty = {
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.priv_defaults = &(const struct priv) { .priv_defaults = &(const struct priv) {
.shm_fd = -1, .shm_fd = -1,
.opts.config_clear = 1, .opts.config_clear = true,
.opts.alt_screen = 1, .opts.alt_screen = true,
}, },
.options = (const m_option_t[]) { .options = (const m_option_t[]) {
{"width", OPT_INT(opts.width)}, {"width", OPT_INT(opts.width)},
@ -424,9 +424,9 @@ const struct vo_driver video_out_kitty = {
{"left", OPT_INT(opts.left)}, {"left", OPT_INT(opts.left)},
{"rows", OPT_INT(opts.rows)}, {"rows", OPT_INT(opts.rows)},
{"cols", OPT_INT(opts.cols)}, {"cols", OPT_INT(opts.cols)},
{"config-clear", OPT_FLAG(opts.config_clear), }, {"config-clear", OPT_BOOL(opts.config_clear), },
{"alt-screen", OPT_FLAG(opts.alt_screen), }, {"alt-screen", OPT_BOOL(opts.alt_screen), },
{"use-shm", OPT_FLAG(opts.use_shm), }, {"use-shm", OPT_BOOL(opts.use_shm), },
{0} {0}
}, },
.options_prefix = "vo-kitty", .options_prefix = "vo-kitty",

View File

@ -95,8 +95,8 @@ struct priv {
int display_nr; int display_nr;
int layer; int layer;
int background; bool background;
int enable_osd; bool enable_osd;
}; };
// Magic alignments (in pixels) expected by the MMAL internals. // Magic alignments (in pixels) expected by the MMAL internals.
@ -916,8 +916,8 @@ fail:
static const struct m_option options[] = { static const struct m_option options[] = {
{"display", OPT_INT(display_nr)}, {"display", OPT_INT(display_nr)},
{"layer", OPT_INT(layer), OPTDEF_INT(-10)}, {"layer", OPT_INT(layer), OPTDEF_INT(-10)},
{"background", OPT_FLAG(background)}, {"background", OPT_BOOL(background)},
{"osd", OPT_FLAG(enable_osd), OPTDEF_INT(1)}, {"osd", OPT_BOOL(enable_osd), OPTDEF_INT(1)},
{0}, {0},
}; };

View File

@ -192,9 +192,9 @@ struct priv {
struct m_config_cache *opts_cache; struct m_config_cache *opts_cache;
// options // options
int allow_sw; bool allow_sw;
int switch_mode; bool switch_mode;
int vsync; bool vsync;
}; };
static bool lock_texture(struct vo *vo, struct mp_image *texmpi) static bool lock_texture(struct vo *vo, struct mp_image *texmpi)
@ -240,7 +240,7 @@ static bool lock_texture(struct vo *vo, struct mp_image *texmpi)
} }
static bool is_good_renderer(SDL_RendererInfo *ri, static bool is_good_renderer(SDL_RendererInfo *ri,
const char *driver_name_wanted, int allow_sw, const char *driver_name_wanted, bool allow_sw,
struct formatmap_entry *osd_format) struct formatmap_entry *osd_format)
{ {
if (driver_name_wanted && driver_name_wanted[0]) if (driver_name_wanted && driver_name_wanted[0])
@ -975,13 +975,12 @@ const struct vo_driver video_out_sdl = {
.priv_size = sizeof(struct priv), .priv_size = sizeof(struct priv),
.priv_defaults = &(const struct priv) { .priv_defaults = &(const struct priv) {
.renderer_index = -1, .renderer_index = -1,
.vsync = 1, .vsync = true,
.screensaver_enabled = false,
}, },
.options = (const struct m_option []){ .options = (const struct m_option []){
{"sw", OPT_FLAG(allow_sw)}, {"sw", OPT_BOOL(allow_sw)},
{"switch-mode", OPT_FLAG(switch_mode)}, {"switch-mode", OPT_BOOL(switch_mode)},
{"vsync", OPT_FLAG(vsync)}, {"vsync", OPT_BOOL(vsync)},
{NULL} {NULL}
}, },
.preinit = preinit, .preinit = preinit,

View File

@ -51,13 +51,13 @@
struct vo_sixel_opts { struct vo_sixel_opts {
int diffuse; int diffuse;
int reqcolors; int reqcolors;
int fixedpal; bool fixedpal;
int threshold; int threshold;
int width, height, top, left; int width, height, top, left;
int pad_y, pad_x; int pad_y, pad_x;
int rows, cols; int rows, cols;
int config_clear, alt_screen; bool config_clear, alt_screen;
int buffered; bool buffered;
}; };
struct priv { struct priv {
@ -591,16 +591,15 @@ const struct vo_driver video_out_sixel = {
.opts.height = 0, .opts.height = 0,
.opts.reqcolors = 256, .opts.reqcolors = 256,
.opts.threshold = -1, .opts.threshold = -1,
.opts.fixedpal = 1, .opts.fixedpal = true,
.opts.top = 0, .opts.top = 0,
.opts.left = 0, .opts.left = 0,
.opts.pad_y = -1, .opts.pad_y = -1,
.opts.pad_x = -1, .opts.pad_x = -1,
.opts.rows = 0, .opts.rows = 0,
.opts.cols = 0, .opts.cols = 0,
.opts.config_clear = 1, .opts.config_clear = true,
.opts.alt_screen = 1, .opts.alt_screen = true,
.opts.buffered = 0,
}, },
.options = (const m_option_t[]) { .options = (const m_option_t[]) {
{"dither", OPT_CHOICE(opts.diffuse, {"dither", OPT_CHOICE(opts.diffuse,
@ -616,7 +615,7 @@ const struct vo_driver video_out_sixel = {
{"width", OPT_INT(opts.width)}, {"width", OPT_INT(opts.width)},
{"height", OPT_INT(opts.height)}, {"height", OPT_INT(opts.height)},
{"reqcolors", OPT_INT(opts.reqcolors)}, {"reqcolors", OPT_INT(opts.reqcolors)},
{"fixedpalette", OPT_FLAG(opts.fixedpal)}, {"fixedpalette", OPT_BOOL(opts.fixedpal)},
{"threshold", OPT_INT(opts.threshold)}, {"threshold", OPT_INT(opts.threshold)},
{"top", OPT_INT(opts.top)}, {"top", OPT_INT(opts.top)},
{"left", OPT_INT(opts.left)}, {"left", OPT_INT(opts.left)},
@ -624,11 +623,11 @@ const struct vo_driver video_out_sixel = {
{"pad-x", OPT_INT(opts.pad_x)}, {"pad-x", OPT_INT(opts.pad_x)},
{"rows", OPT_INT(opts.rows)}, {"rows", OPT_INT(opts.rows)},
{"cols", OPT_INT(opts.cols)}, {"cols", OPT_INT(opts.cols)},
{"config-clear", OPT_FLAG(opts.config_clear), }, {"config-clear", OPT_BOOL(opts.config_clear), },
{"exit-clear", OPT_FLAG(opts.alt_screen), {"exit-clear", OPT_BOOL(opts.alt_screen),
.deprecation_message = "replaced by --vo-sixel-alt-screen"}, .deprecation_message = "replaced by --vo-sixel-alt-screen"},
{"alt-screen", OPT_FLAG(opts.alt_screen), }, {"alt-screen", OPT_BOOL(opts.alt_screen), },
{"buffered", OPT_FLAG(opts.buffered), }, {"buffered", OPT_BOOL(opts.buffered), },
{0} {0}
}, },
.options_prefix = "vo-sixel", .options_prefix = "vo-sixel",

View File

@ -52,7 +52,7 @@ struct vo_tct_opts {
int algo; int algo;
int width; // 0 -> default int width; // 0 -> default
int height; // 0 -> default int height; // 0 -> default
int term256; // 0 -> true color bool term256; // 0 -> true color
}; };
struct lut_item { struct lut_item {
@ -339,7 +339,7 @@ const struct vo_driver video_out_tct = {
{"half-blocks", ALGO_HALF_BLOCKS})}, {"half-blocks", ALGO_HALF_BLOCKS})},
{"width", OPT_INT(opts.width)}, {"width", OPT_INT(opts.width)},
{"height", OPT_INT(opts.height)}, {"height", OPT_INT(opts.height)},
{"256", OPT_FLAG(opts.term256)}, {"256", OPT_BOOL(opts.term256)},
{0} {0}
}, },
.options_prefix = "vo-tct", .options_prefix = "vo-tct",

View File

@ -81,7 +81,7 @@ struct priv {
int output_surface; int output_surface;
int visible_surface; int visible_surface;
int scaling; int scaling;
int force_scaled_osd; bool force_scaled_osd;
VAImageFormat osd_format; // corresponds to OSD_VA_FORMAT VAImageFormat osd_format; // corresponds to OSD_VA_FORMAT
struct vaapi_osd_part osd_part; struct vaapi_osd_part osd_part;
@ -873,7 +873,7 @@ const struct vo_driver video_out_vaapi = {
{"fast", VA_FILTER_SCALING_FAST}, {"fast", VA_FILTER_SCALING_FAST},
{"hq", VA_FILTER_SCALING_HQ}, {"hq", VA_FILTER_SCALING_HQ},
{"nla", VA_FILTER_SCALING_NL_ANAMORPHIC})}, {"nla", VA_FILTER_SCALING_NL_ANAMORPHIC})},
{"scaled-osd", OPT_FLAG(force_scaled_osd)}, {"scaled-osd", OPT_BOOL(force_scaled_osd)},
{0} {0}
}, },
.options_prefix = "vo-vaapi", .options_prefix = "vo-vaapi",

View File

@ -85,13 +85,13 @@ struct vdpctx {
int output_surface_w, output_surface_h; int output_surface_w, output_surface_h;
int rotation; int rotation;
int force_yuv; bool force_yuv;
struct mp_vdpau_mixer *video_mixer; struct mp_vdpau_mixer *video_mixer;
int pullup; bool pullup;
float denoise; float denoise;
float sharpen; float sharpen;
int hqscaling; int hqscaling;
int chroma_deint; bool chroma_deint;
int flip_offset_window; int flip_offset_window;
int flip_offset_fs; int flip_offset_fs;
int64_t flip_offset_us; int64_t flip_offset_us;
@ -105,7 +105,7 @@ struct vdpctx {
int query_surface_num; int query_surface_num;
VdpTime recent_vsync_time; VdpTime recent_vsync_time;
float user_fps; float user_fps;
int composite_detect; bool composite_detect;
int vsync_interval; int vsync_interval;
uint64_t last_queue_time; uint64_t last_queue_time;
uint64_t queue_time[MAX_OUTPUT_SURFACES]; uint64_t queue_time[MAX_OUTPUT_SURFACES];
@ -1118,20 +1118,20 @@ const struct vo_driver video_out_vdpau = {
.uninit = uninit, .uninit = uninit,
.priv_size = sizeof(struct vdpctx), .priv_size = sizeof(struct vdpctx),
.options = (const struct m_option []){ .options = (const struct m_option []){
{"chroma-deint", OPT_FLAG(chroma_deint), OPTDEF_INT(1)}, {"chroma-deint", OPT_BOOL(chroma_deint), OPTDEF_INT(1)},
{"pullup", OPT_FLAG(pullup)}, {"pullup", OPT_BOOL(pullup)},
{"denoise", OPT_FLOAT(denoise), M_RANGE(0, 1)}, {"denoise", OPT_FLOAT(denoise), M_RANGE(0, 1)},
{"sharpen", OPT_FLOAT(sharpen), M_RANGE(-1, 1)}, {"sharpen", OPT_FLOAT(sharpen), M_RANGE(-1, 1)},
{"hqscaling", OPT_INT(hqscaling), M_RANGE(0, 9)}, {"hqscaling", OPT_INT(hqscaling), M_RANGE(0, 9)},
{"fps", OPT_FLOAT(user_fps)}, {"fps", OPT_FLOAT(user_fps)},
{"composite-detect", OPT_FLAG(composite_detect), OPTDEF_INT(1)}, {"composite-detect", OPT_BOOL(composite_detect), OPTDEF_INT(1)},
{"queuetime-windowed", OPT_INT(flip_offset_window), OPTDEF_INT(50)}, {"queuetime-windowed", OPT_INT(flip_offset_window), OPTDEF_INT(50)},
{"queuetime-fs", OPT_INT(flip_offset_fs), OPTDEF_INT(50)}, {"queuetime-fs", OPT_INT(flip_offset_fs), OPTDEF_INT(50)},
{"output-surfaces", OPT_INT(num_output_surfaces), {"output-surfaces", OPT_INT(num_output_surfaces),
M_RANGE(2, MAX_OUTPUT_SURFACES), OPTDEF_INT(3)}, M_RANGE(2, MAX_OUTPUT_SURFACES), OPTDEF_INT(3)},
{"colorkey", OPT_COLOR(colorkey), {"colorkey", OPT_COLOR(colorkey),
.defval = &(const struct m_color){.r = 2, .g = 5, .b = 7, .a = 255}}, .defval = &(const struct m_color){.r = 2, .g = 5, .b = 7, .a = 255}},
{"force-yuv", OPT_FLAG(force_yuv)}, {"force-yuv", OPT_BOOL(force_yuv)},
{"queuetime_windowed", OPT_REPLACED("queuetime-windowed")}, {"queuetime_windowed", OPT_REPLACED("queuetime-windowed")},
{"queuetime_fs", OPT_REPLACED("queuetime-fs")}, {"queuetime_fs", OPT_REPLACED("queuetime-fs")},
{"output_surfaces", OPT_REPLACED("output-surfaces")}, {"output_surfaces", OPT_REPLACED("output-surfaces")},

View File

@ -25,8 +25,8 @@ struct vulkan_opts {
char *device; // force a specific GPU char *device; // force a specific GPU
int swap_mode; int swap_mode;
int queue_count; int queue_count;
int async_transfer; bool async_transfer;
int async_compute; bool async_compute;
}; };
static int vk_validate_dev(struct mp_log *log, const struct m_option *opt, static int vk_validate_dev(struct mp_log *log, const struct m_option *opt,
@ -96,8 +96,8 @@ const struct m_sub_options vulkan_conf = {
{"mailbox", VK_PRESENT_MODE_MAILBOX_KHR}, {"mailbox", VK_PRESENT_MODE_MAILBOX_KHR},
{"immediate", VK_PRESENT_MODE_IMMEDIATE_KHR})}, {"immediate", VK_PRESENT_MODE_IMMEDIATE_KHR})},
{"vulkan-queue-count", OPT_INT(queue_count), M_RANGE(1, 8)}, {"vulkan-queue-count", OPT_INT(queue_count), M_RANGE(1, 8)},
{"vulkan-async-transfer", OPT_FLAG(async_transfer)}, {"vulkan-async-transfer", OPT_BOOL(async_transfer)},
{"vulkan-async-compute", OPT_FLAG(async_compute)}, {"vulkan-async-compute", OPT_BOOL(async_compute)},
{"vulkan-disable-events", OPT_REMOVED("Unused")}, {"vulkan-disable-events", OPT_REMOVED("Unused")},
{0} {0}
}, },

View File

@ -133,7 +133,7 @@ const struct m_sub_options wayland_conf = {
.opts = (const struct m_option[]) { .opts = (const struct m_option[]) {
{"wayland-configure-bounds", OPT_CHOICE(configure_bounds, {"wayland-configure-bounds", OPT_CHOICE(configure_bounds,
{"auto", -1}, {"no", 0}, {"yes", 1})}, {"auto", -1}, {"no", 0}, {"yes", 1})},
{"wayland-disable-vsync", OPT_FLAG(disable_vsync)}, {"wayland-disable-vsync", OPT_BOOL(disable_vsync)},
{"wayland-edge-pixels-pointer", OPT_INT(edge_pixels_pointer), {"wayland-edge-pixels-pointer", OPT_INT(edge_pixels_pointer),
M_RANGE(0, INT_MAX)}, M_RANGE(0, INT_MAX)},
{"wayland-edge-pixels-touch", OPT_INT(edge_pixels_touch), {"wayland-edge-pixels-touch", OPT_INT(edge_pixels_touch),
@ -143,7 +143,6 @@ const struct m_sub_options wayland_conf = {
.size = sizeof(struct wayland_opts), .size = sizeof(struct wayland_opts),
.defaults = &(struct wayland_opts) { .defaults = &(struct wayland_opts) {
.configure_bounds = -1, .configure_bounds = -1,
.disable_vsync = false,
.edge_pixels_pointer = 10, .edge_pixels_pointer = 10,
.edge_pixels_touch = 32, .edge_pixels_touch = 32,
}, },

View File

@ -31,7 +31,7 @@ typedef struct {
struct wayland_opts { struct wayland_opts {
int configure_bounds; int configure_bounds;
int content_type; int content_type;
int disable_vsync; bool disable_vsync;
int edge_pixels_pointer; int edge_pixels_pointer;
int edge_pixels_touch; int edge_pixels_touch;
}; };

View File

@ -52,9 +52,9 @@ struct sws_opts {
int chr_hshift; int chr_hshift;
float chr_sharpen; float chr_sharpen;
float lum_sharpen; float lum_sharpen;
int fast; bool fast;
int bitexact; bool bitexact;
int zimg; bool zimg;
}; };
#define OPT_BASE_STRUCT struct sws_opts #define OPT_BASE_STRUCT struct sws_opts
@ -78,15 +78,15 @@ const struct m_sub_options sws_conf = {
{"chs", OPT_INT(chr_hshift)}, {"chs", OPT_INT(chr_hshift)},
{"ls", OPT_FLOAT(lum_sharpen), M_RANGE(-100.0, 100.0)}, {"ls", OPT_FLOAT(lum_sharpen), M_RANGE(-100.0, 100.0)},
{"cs", OPT_FLOAT(chr_sharpen), M_RANGE(-100.0, 100.0)}, {"cs", OPT_FLOAT(chr_sharpen), M_RANGE(-100.0, 100.0)},
{"fast", OPT_FLAG(fast)}, {"fast", OPT_BOOL(fast)},
{"bitexact", OPT_FLAG(bitexact)}, {"bitexact", OPT_BOOL(bitexact)},
{"allow-zimg", OPT_FLAG(zimg)}, {"allow-zimg", OPT_BOOL(zimg)},
{0} {0}
}, },
.size = sizeof(struct sws_opts), .size = sizeof(struct sws_opts),
.defaults = &(const struct sws_opts){ .defaults = &(const struct sws_opts){
.scaler = SWS_LANCZOS, .scaler = SWS_LANCZOS,
.zimg = 1, .zimg = true,
}, },
}; };

View File

@ -9,8 +9,8 @@
struct mp_vdpau_mixer_opts { struct mp_vdpau_mixer_opts {
int deint; int deint;
int chroma_deint; bool chroma_deint;
int pullup; bool pullup;
float denoise; float denoise;
float sharpen; float sharpen;
int hqscaling; int hqscaling;

View File

@ -51,7 +51,7 @@ const struct zimg_opts zimg_opts_defaults = {
.scaler_chroma_params = {NAN, NAN}, .scaler_chroma_params = {NAN, NAN},
.scaler_chroma = ZIMG_RESIZE_BILINEAR, .scaler_chroma = ZIMG_RESIZE_BILINEAR,
.dither = ZIMG_DITHER_RANDOM, .dither = ZIMG_DITHER_RANDOM,
.fast = 1, .fast = true,
}; };
#define OPT_PARAM(var) OPT_DOUBLE(var), .flags = M_OPT_DEFAULT_NAN #define OPT_PARAM(var) OPT_DOUBLE(var), .flags = M_OPT_DEFAULT_NAN
@ -70,7 +70,7 @@ const struct m_sub_options zimg_conf = {
{"ordered", ZIMG_DITHER_ORDERED}, {"ordered", ZIMG_DITHER_ORDERED},
{"random", ZIMG_DITHER_RANDOM}, {"random", ZIMG_DITHER_RANDOM},
{"error-diffusion", ZIMG_DITHER_ERROR_DIFFUSION})}, {"error-diffusion", ZIMG_DITHER_ERROR_DIFFUSION})},
{"fast", OPT_FLAG(fast)}, {"fast", OPT_BOOL(fast)},
{"threads", OPT_CHOICE(threads, {"auto", 0}), M_RANGE(1, 64)}, {"threads", OPT_CHOICE(threads, {"auto", 0}), M_RANGE(1, 64)},
{0} {0}
}, },

View File

@ -19,7 +19,7 @@ struct zimg_opts {
int scaler_chroma; int scaler_chroma;
double scaler_chroma_params[2]; double scaler_chroma_params[2];
int dither; int dither;
int fast; bool fast;
int threads; int threads;
}; };