diff options
author | wm4 <wm4@nowhere> | 2017-02-02 18:38:16 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-02 18:38:16 +0100 |
commit | 95d4c2d7f61155633e89c18e740e7cf743a655d6 (patch) | |
tree | 89cb0fe2797eee4e54dfb693e485e4897682b950 /player | |
parent | fb9a32977d6abf4c83a92d993af58e393819c062 (diff) | |
download | mpv-95d4c2d7f61155633e89c18e740e7cf743a655d6.tar.bz2 mpv-95d4c2d7f61155633e89c18e740e7cf743a655d6.tar.xz |
player: different way to auto-enable the demuxer cache
Instead of enabling it only when a stream-cache is enabled, also try to
enable it independently from that if the demuxer is marked as
is_network.
Also add some code to the EDL code, so EDLs containing network streams
are automatically cached this way.
Extend the OSD info line so that it shows the demuxer cache in this case
(more or less).
I didn't find where or whether options.rst describes how the demuxer
cache is enabled, so no changes there.
Diffstat (limited to 'player')
-rw-r--r-- | player/osd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/player/osd.c b/player/osd.c index 2b95a10705..75f4cdcf7b 100644 --- a/player/osd.c +++ b/player/osd.c @@ -262,7 +262,7 @@ static void term_osd_print_status_lazy(struct MPContext *mpctx) if (mpctx->demuxer) { struct stream_cache_info info = {0}; demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_INFO, &info); - if (info.size > 0) { + if (info.size > 0 || mpctx->demuxer->is_network) { saddf(&line, " Cache: "); struct demux_ctrl_reader_state s = {.ts_duration = -1}; @@ -273,10 +273,12 @@ static void term_osd_print_status_lazy(struct MPContext *mpctx) } else { saddf(&line, "%2ds", (int)s.ts_duration); } - if (info.fill >= 1024 * 1024) { - saddf(&line, "+%lldMB", (long long)(info.fill / 1024 / 1024)); - } else { - saddf(&line, "+%lldKB", (long long)(info.fill / 1024)); + if (info.size > 0) { + if (info.fill >= 1024 * 1024) { + saddf(&line, "+%lldMB", (long long)(info.fill / 1024 / 1024)); + } else { + saddf(&line, "+%lldKB", (long long)(info.fill / 1024)); + } } } } |