From ae1aeab7aa2b7c378a9f734d227121f84ae85ed2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Mar 2020 00:28:09 +0100 Subject: options: make decoder options local to decoder wrapper Instead of having f_decoder_wrapper create its own copy of the entire mpv option tree, create a struct local to that file and move all used options to there. movie_aspect is used by the "video-aspect" deprecated property code. I think it's probably better not to remove the property yet, but fortunately it's easy to work around without needing special handling for this option or so. correct_pts is used to prevent use of hr-seek in playloop.c. Ignore that, if you use --no-correct-pts you're asking for trouble anyway. This is the only behavior change. --- options/options.c | 28 +--------------------------- options/options.h | 18 ++---------------- 2 files changed, 3 insertions(+), 43 deletions(-) (limited to 'options') diff --git a/options/options.c b/options/options.c index 8eab3598be..3eebc2e0df 100644 --- a/options/options.c +++ b/options/options.c @@ -437,8 +437,6 @@ static const m_option_t mp_opts[] = { OPT_CHOICE("play-dir", play_dir, 0, ({"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})), - OPT_BYTE_SIZE("video-reversal-buffer", video_reverse_size, 0, 0, (size_t)-1), - OPT_BYTE_SIZE("audio-reversal-buffer", audio_reverse_size, 0, 0, (size_t)-1), OPT_FLAG("rebase-start-time", rebase_start_time, 0), @@ -515,8 +513,6 @@ static const m_option_t mp_opts[] = { // set A-V sync correction speed (0=disables it): OPT_FLOATRANGE("mc", default_max_pts_correction, 0, 0, 100), - // force video/audio rate: - OPT_DOUBLE("fps", force_fps, CONF_MIN, .min = 0), OPT_INTRANGE("audio-samplerate", force_srate, UPDATE_AUDIO, 0, 16*48000), OPT_CHANNELS("audio-channels", audio_output_channels, UPDATE_AUDIO), OPT_AUDIOFORMAT("audio-format", audio_output_format, UPDATE_AUDIO), @@ -538,22 +534,10 @@ static const m_option_t mp_opts[] = { OPT_SUBSTRUCT("", filter_opts, filter_conf, 0), - OPT_STRING("ad", audio_decoders, 0), - OPT_STRING("vd", video_decoders, 0), - - OPT_STRING("audio-spdif", audio_spdif, 0), - - OPT_ASPECT("video-aspect-override", movie_aspect, UPDATE_IMGPAR | M_OPT_RANGE, - .min = -1, .max = 10), - OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR, - ({"bitstream", 1}, {"container", 2})), - + OPT_SUBSTRUCT("", dec_wrapper, dec_wrapper_conf, 0), OPT_SUBSTRUCT("", vd_lavc_params, vd_lavc_conf, 0), OPT_SUBSTRUCT("ad-lavc", ad_lavc_params, ad_lavc_conf, 0), - OPT_SUBSTRUCT("vd-queue", vdec_queue_opts, vdec_queue_conf, 0), - OPT_SUBSTRUCT("ad-queue", adec_queue_opts, adec_queue_conf, 0), - OPT_SUBSTRUCT("", demux_lavf, demux_lavf_conf, 0), OPT_SUBSTRUCT("demuxer-rawaudio", demux_rawaudio, demux_rawaudio_conf, 0), OPT_SUBSTRUCT("demuxer-rawvideo", demux_rawvideo, demux_rawvideo_conf, 0), @@ -610,8 +594,6 @@ static const m_option_t mp_opts[] = { OPT_STRING("title", wintitle, 0), OPT_STRING("force-media-title", media_title, 0), - OPT_CHOICE_OR_INT("video-rotate", video_rotate, UPDATE_IMGPAR, 0, 359, - ({"no", -1})), OPT_CHOICE_OR_INT("cursor-autohide", cursor_autohide_delay, 0, 0, 30000, ({"no", -1}, {"always", -2})), @@ -674,7 +656,6 @@ static const m_option_t mp_opts[] = { OPT_FLAG("merge-files", merge_files, 0), // a-v sync stuff: - OPT_FLAG("correct-pts", correct_pts, 0), OPT_FLAG("initial-audio-sync", initial_audio_sync, 0), OPT_CHOICE("video-sync", video_sync, 0, ({"audio", VS_DEFAULT}, @@ -925,8 +906,6 @@ static const m_option_t mp_opts[] = { static const struct MPOpts mp_default_opts = { .use_terminal = 1, .msg_color = 1, - .audio_decoders = NULL, - .video_decoders = NULL, .softvol_max = 130, .softvol_volume = 100, .softvol_mute = 0, @@ -968,7 +947,6 @@ static const struct MPOpts mp_default_opts = { .ab_loop_count = -1, .edition_id = -1, .default_max_pts_correction = -1, - .correct_pts = 1, .initial_audio_sync = 1, .frame_dropping = 1, .term_osd = 2, @@ -991,15 +969,11 @@ static const struct MPOpts mp_default_opts = { .audio_output_format = 0, // AF_FORMAT_UNKNOWN .playback_speed = 1., .pitch_correction = 1, - .movie_aspect = -1., - .aspect_method = 2, .sub_auto = 0, .audiofile_auto = -1, .osd_bar_visible = 1, .screenshot_template = "mpv-shot%n", .play_dir = 1, - .video_reverse_size = 1 * 1024 * 1024 * 1024, - .audio_reverse_size = 64 * 1024 * 1024, .audio_output_channels = { .set = 1, diff --git a/options/options.h b/options/options.h index cf4025a20e..3a0663b6f8 100644 --- a/options/options.h +++ b/options/options.h @@ -172,12 +172,6 @@ typedef struct MPOpts { int cursor_autohide_delay; int cursor_autohide_fs; - int video_rotate; - - char *audio_decoders; - char *video_decoders; - char *audio_spdif; - struct mp_subtitle_opts *subs_rend; struct mp_sub_filter_opts *subs_filt; struct mp_osd_render_opts *osd_rend; @@ -207,7 +201,6 @@ typedef struct MPOpts { int use_filedir_conf; int hls_bitrate; int edition_id; - int correct_pts; int initial_audio_sync; int video_sync; double sync_max_video_change; @@ -266,8 +259,6 @@ typedef struct MPOpts { int prefetch_open; char *audio_demuxer_name; char *sub_demuxer_name; - int64_t video_reverse_size; - int64_t audio_reverse_size; int cache_pause; int cache_pause_initial; @@ -277,7 +268,6 @@ typedef struct MPOpts { char *screenshot_template; char *screenshot_directory; - double force_fps; int index_mode; struct m_channels audio_output_channels; @@ -288,10 +278,7 @@ typedef struct MPOpts { struct m_obj_settings *vf_settings, *vf_defs; struct m_obj_settings *af_settings, *af_defs; struct filter_opts *filter_opts; - float movie_aspect; - int aspect_method; - struct dec_queue_opts *vdec_queue_opts; - struct dec_queue_opts *adec_queue_opts; + struct dec_wrapper_opts *dec_wrapper; char **sub_name; char **sub_paths; char **audiofile_paths; @@ -375,8 +362,7 @@ extern const struct m_sub_options mp_osd_render_sub_opts; extern const struct m_sub_options filter_conf; extern const struct m_sub_options resample_conf; extern const struct m_sub_options stream_conf; -extern const struct m_sub_options vdec_queue_conf; -extern const struct m_sub_options adec_queue_conf; +extern const struct m_sub_options dec_wrapper_conf; extern const struct m_sub_options mp_opt_root; #endif -- cgit v1.2.3