diff options
-rw-r--r-- | DOCS/man/options.rst | 5 | ||||
-rw-r--r-- | demux/demux.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index a33dbac4e8..81f1501048 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2154,6 +2154,9 @@ Demuxer a timestamp difference higher than the readahead amount relative to the last packet returned to the decoder, the demuxer keeps reading. + Note that the ``--cache-secs`` option will override this value if a cache + is enabled, and the value is larger. + (This value tends to be fuzzy, because many file formats don't store linear timestamps.) @@ -3027,7 +3030,7 @@ Cache ``--cache-secs=<seconds>`` How many seconds of audio/video to prefetch if the cache is active. This overrides the ``--demuxer-readahead-secs`` option if and only if the cache - is enabled. (Default: 2.) + is enabled and the value is larger. (Default: 2.) ``--cache-pause``, ``--no-cache-pause`` Whether the player should automatically pause when the cache runs low, diff --git a/demux/demux.c b/demux/demux.c index 4f185a517e..ea0464cdae 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -841,14 +841,16 @@ static struct demuxer *open_given_type(struct mpv_global *global, .d_thread = talloc(demuxer, struct demuxer), .d_buffer = talloc(demuxer, struct demuxer), .d_user = demuxer, - .min_secs = stream->uncached_stream ? demuxer->opts->demuxer_min_secs_cache - : demuxer->opts->demuxer_min_secs, + .min_secs = demuxer->opts->demuxer_min_secs, .min_packs = demuxer->opts->demuxer_min_packs, .min_bytes = demuxer->opts->demuxer_min_bytes, }; pthread_mutex_init(&in->lock, NULL); pthread_cond_init(&in->wakeup, NULL); + if (stream->uncached_stream) + in->min_secs = MPMAX(in->min_secs, demuxer->opts->demuxer_min_secs_cache); + *in->d_thread = *demuxer; *in->d_buffer = *demuxer; |