summaryrefslogtreecommitdiffstats
path: root/player/osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-29 11:29:52 +0200
committerwm4 <wm4@nowhere>2016-03-29 11:29:52 +0200
commit57506b27ed0d567c11bd932cf758318fb3b2079c (patch)
treef9bfbdf9ca316546f6de72d16b837411cb95e423 /player/osd.c
parente1264d397613b0dac86757d6fd3a4a3494e16868 (diff)
downloadmpv-57506b27ed0d567c11bd932cf758318fb3b2079c.tar.bz2
mpv-57506b27ed0d567c11bd932cf758318fb3b2079c.tar.xz
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.
Diffstat (limited to 'player/osd.c')
-rw-r--r--player/osd.c12
1 files changed, 6 insertions, 6 deletions
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));
}
}
}