From 57506b27ed0d567c11bd932cf758318fb3b2079c Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Mar 2016 11:29:52 +0200 Subject: cache: use a single STREAM_CTRL for various cache info Instead of having a separate for each, which also requires separate additional caching in the demuxer. (The demuxer adds an indirection, since STREAM_CTRLs are not thread-safe.) Since this includes the cache speed, this should fix #3003. --- player/osd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'player/osd.c') diff --git a/player/osd.c b/player/osd.c index 1baf9fb45e..8c6d8a3af1 100644 --- a/player/osd.c +++ b/player/osd.c @@ -257,9 +257,9 @@ static void print_status(struct MPContext *mpctx) } if (mpctx->demuxer) { - int64_t fill = -1; - demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_FILL, &fill); - if (fill >= 0) { + struct stream_cache_info info = {0}; + demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_INFO, &info); + if (info.fill >= 0) { saddf(&line, " Cache: "); struct demux_ctrl_reader_state s = {.ts_duration = -1}; @@ -270,10 +270,10 @@ static void print_status(struct MPContext *mpctx) } else { saddf(&line, "%2ds", (int)s.ts_duration); } - if (fill >= 1024 * 1024) { - saddf(&line, "+%lldMB", (long long)(fill / 1024 / 1024)); + if (info.fill >= 1024 * 1024) { + saddf(&line, "+%lldMB", (long long)(info.fill / 1024 / 1024)); } else { - saddf(&line, "+%lldKB", (long long)(fill / 1024)); + saddf(&line, "+%lldKB", (long long)(info.fill / 1024)); } } } -- cgit v1.2.3