summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-19 15:58:34 -0500
committerDudemanguy <random342@airmail.cc>2023-09-22 14:20:38 +0000
commitb2edd4312d06de7ced543e2e389c1e3866c27755 (patch)
tree04ed2f17c38d3dd879fc2344fd6a1c68a1ae5e4a /demux/demux_lavf.c
parenta343666ab5121e7a3388be9aa2d8731d6d1f2f64 (diff)
downloadmpv-b2edd4312d06de7ced543e2e389c1e3866c27755.tar.bz2
mpv-b2edd4312d06de7ced543e2e389c1e3866c27755.tar.xz
demuxer: remove several mp_read_option_raw calls
With the previous commit, we can just access option values directly now and avoid a lot of complication. Note that the mp_read_option_raw call for edition requires calling mp_get_config_group since that option needs to live in MPOpts.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 81791915f2..7ef87946bc 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -244,7 +244,6 @@ typedef struct lavf_priv {
double seek_delay;
struct demux_lavf_opts *opts;
- double mf_fps;
bool pcm_seek_hack_disabled;
AVStream *pcm_seek_hack;
@@ -746,7 +745,7 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
if (is_image(st, sh->attached_picture, priv->avif)) {
MP_VERBOSE(demuxer, "Assuming this is an image format.\n");
sh->image = true;
- sh->codec->fps = priv->mf_fps;
+ sh->codec->fps = demuxer->opts->mf_fps;
}
sh->codec->par_w = st->sample_aspect_ratio.num;
sh->codec->par_h = st->sample_aspect_ratio.den;
@@ -981,12 +980,6 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
priv->opts = mp_get_config_group(priv, demuxer->global, &demux_lavf_conf);
struct demux_lavf_opts *lavfdopts = priv->opts;
- int index_mode;
- mp_read_option_raw(demuxer->global, "index", &m_option_type_choice,
- &index_mode);
- mp_read_option_raw(demuxer->global, "mf-fps", &m_option_type_double,
- &priv->mf_fps);
-
if (lavf_check_file(demuxer, check) < 0)
goto fail;
@@ -994,7 +987,7 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
if (!avfc)
goto fail;
- if (index_mode != 1)
+ if (demuxer->opts->index_mode != 1)
avfc->flags |= AVFMT_FLAG_IGNIDX;
if (lavfdopts->probesize) {