mirror of https://github.com/mpv-player/mpv
player: don't load encoding mode profile twice
Also move the loading of profiles and input section activation in one place. Leaving this in mp_initialize has the drawback that encoding section profile will overwrite options set by the user in the command line, since it's set after the CLI options are parsed and processed. mp_parse_cfgfiles happens before parsing the CLI, so loading the profile there is better.
This commit is contained in:
parent
e28bfadbea
commit
5b946ac360
|
@ -44,6 +44,7 @@
|
||||||
#include "common/playlist.h"
|
#include "common/playlist.h"
|
||||||
#include "options/options.h"
|
#include "options/options.h"
|
||||||
#include "options/m_property.h"
|
#include "options/m_property.h"
|
||||||
|
#include "input/input.h"
|
||||||
|
|
||||||
#include "stream/stream.h"
|
#include "stream/stream.h"
|
||||||
|
|
||||||
|
@ -91,8 +92,10 @@ void mp_parse_cfgfiles(struct MPContext *mpctx)
|
||||||
|
|
||||||
load_all_cfgfiles(mpctx, section, "mpv.conf|config");
|
load_all_cfgfiles(mpctx, section, "mpv.conf|config");
|
||||||
|
|
||||||
if (encoding)
|
if (encoding) {
|
||||||
m_config_set_profile(mpctx->mconfig, SECT_ENCODE, 0);
|
m_config_set_profile(mpctx->mconfig, SECT_ENCODE, 0);
|
||||||
|
mp_input_enable_section(mpctx->input, "encode", MP_INPUT_EXCLUSIVE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int try_load_config(struct MPContext *mpctx, const char *file, int flags,
|
static int try_load_config(struct MPContext *mpctx, const char *file, int flags,
|
||||||
|
|
|
@ -415,8 +415,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
|
||||||
MP_INFO(mpctx, "Encoding initialization failed.\n");
|
MP_INFO(mpctx, "Encoding initialization failed.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
m_config_set_profile(mpctx->mconfig, "encoding", 0);
|
|
||||||
mp_input_enable_section(mpctx->input, "encode", MP_INPUT_EXCLUSIVE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_load_scripts(mpctx);
|
mp_load_scripts(mpctx);
|
||||||
|
|
Loading…
Reference in New Issue