mirror of https://github.com/mpv-player/mpv
demux_lavf: add --demuxer-lavf-probe-info=nostreams
Another attempt to try to make it behave in certain situations.
This commit is contained in:
parent
16d033814c
commit
16eca7139a
|
@ -2718,7 +2718,7 @@ Demuxer
|
|||
``--demuxer-lavf-analyzeduration=<value>``
|
||||
Maximum length in seconds to analyze the stream properties.
|
||||
|
||||
``--demuxer-lavf-probe-info=<yes|no|auto>``
|
||||
``--demuxer-lavf-probe-info=<yes|no|auto|nostreams>``
|
||||
Whether to probe stream information (default: auto). Technically, this
|
||||
controls whether libavformat's ``avformat_find_stream_info()`` function
|
||||
is called. Usually it's safer to call it, but it can also make startup
|
||||
|
@ -2727,6 +2727,10 @@ Demuxer
|
|||
The ``auto`` choice (the default) tries to skip this for a few know-safe
|
||||
whitelisted formats, while calling it for everything else.
|
||||
|
||||
The ``nostreams`` choice only calls it if and only if the file seems to
|
||||
contain no streams after opening (helpful in cases when calling the function
|
||||
is needed to detect streams at all, such as with FLV files).
|
||||
|
||||
``--demuxer-lavf-probescore=<1-100>``
|
||||
Minimum required libavformat probe score. Lower values will require
|
||||
less data to be loaded (makes streams start faster), but makes file
|
||||
|
|
|
@ -82,7 +82,7 @@ const struct m_sub_options demux_lavf_conf = {
|
|||
.opts = (const m_option_t[]) {
|
||||
OPT_INTRANGE("demuxer-lavf-probesize", probesize, 0, 32, INT_MAX),
|
||||
OPT_CHOICE("demuxer-lavf-probe-info", probeinfo, 0,
|
||||
({"no", 0}, {"yes", 1}, {"auto", -1})),
|
||||
({"no", 0}, {"yes", 1}, {"auto", -1}, {"nostreams", -2})),
|
||||
OPT_STRING("demuxer-lavf-format", format, 0),
|
||||
OPT_FLOATRANGE("demuxer-lavf-analyzeduration", analyzeduration, 0,
|
||||
0, 3600),
|
||||
|
@ -892,8 +892,11 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
|
|||
|
||||
priv->avfc = avfc;
|
||||
|
||||
bool probeinfo = lavfdopts->probeinfo < 0 ?
|
||||
!priv->format_hack.skipinfo : lavfdopts->probeinfo;
|
||||
bool probeinfo = lavfdopts->probeinfo != 0;
|
||||
switch (lavfdopts->probeinfo) {
|
||||
case -2: probeinfo = priv->avfc->nb_streams == 0; break;
|
||||
case -1: probeinfo = !priv->format_hack.skipinfo; break;
|
||||
}
|
||||
if (demuxer->params && demuxer->params->skip_lavf_probing)
|
||||
probeinfo = false;
|
||||
if (probeinfo) {
|
||||
|
|
Loading…
Reference in New Issue