mirror of
https://github.com/mpv-player/mpv
synced 2024-11-07 01:47:00 +01:00
demuxer_lavf: add an option for disabling hacks
This commit is contained in:
parent
55ba4db742
commit
01cfcd6814
@ -2022,6 +2022,12 @@ Demuxer
|
||||
``--demuxer-lavf-format=<name>``
|
||||
Force a specific libavformat demuxer.
|
||||
|
||||
``--demuxer-lavf-hacks=<yes|no>``
|
||||
By default, some formats will be handled differently from other formats
|
||||
by explicitly checking for them. Most of these compensate for weird or
|
||||
imperfect behavior from libavformat demuxers. Passing ``no`` disables
|
||||
these. For debugging and testing only.
|
||||
|
||||
``--demuxer-lavf-genpts-mode=<no|lavf>``
|
||||
Mode for deriving missing packet PTS values from packet DTS. ``lavf``
|
||||
enables libavformat's ``genpts`` option. ``no`` disables it. This used
|
||||
|
@ -65,6 +65,7 @@ struct demux_lavf_opts {
|
||||
char *format;
|
||||
char *cryptokey;
|
||||
char **avopts;
|
||||
int hacks;
|
||||
int genptsmode;
|
||||
};
|
||||
|
||||
@ -78,6 +79,7 @@ const struct m_sub_options demux_lavf_conf = {
|
||||
OPT_FLAG("allow-mimetype", allow_mimetype, 0),
|
||||
OPT_INTRANGE("probescore", probescore, 0, 1, AVPROBE_SCORE_MAX),
|
||||
OPT_STRING("cryptokey", cryptokey, 0),
|
||||
OPT_FLAG("hacks", hacks, 0),
|
||||
OPT_CHOICE("genpts-mode", genptsmode, 0,
|
||||
({"lavf", 1}, {"no", 0})),
|
||||
OPT_KEYVALUELIST("o", avopts, 0),
|
||||
@ -86,6 +88,7 @@ const struct m_sub_options demux_lavf_conf = {
|
||||
.size = sizeof(struct demux_lavf_opts),
|
||||
.defaults = &(const struct demux_lavf_opts){
|
||||
.allow_mimetype = 1,
|
||||
.hacks = 1,
|
||||
// AVPROBE_SCORE_MAX/4 + 1 is the "recommended" limit. Below that, the
|
||||
// user is supposed to retry with larger probe sizes until a higher
|
||||
// value is reached.
|
||||
@ -351,6 +354,8 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
|
||||
|
||||
for (int n = 0; format_hacks[n].ff_name; n++) {
|
||||
const struct format_hack *entry = &format_hacks[n];
|
||||
if (!lavfdopts->hacks)
|
||||
continue;
|
||||
if (!matches_avinputformat_name(priv, entry->ff_name))
|
||||
continue;
|
||||
if (entry->mime_type && strcasecmp(entry->mime_type, mime_type) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user