summaryrefslogtreecommitdiffstats
path: root/player/osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-17 22:11:10 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2017-12-23 00:32:59 +0100
commit822b247d10fe14c83e8d31223a3922f68695a196 (patch)
treef77523d8d6b12519def0a740bb23eac51eb8b315 /player/osd.c
parenta23a98f648857986228237525492b72fc9ee6960 (diff)
downloadmpv-822b247d10fe14c83e8d31223a3922f68695a196.tar.bz2
mpv-822b247d10fe14c83e8d31223a3922f68695a196.tar.xz
player: show demuxer cache buffered amount in bytes in the status line
I don't want to add another field to display stream and demuxer cache separately, so just add them up. This strangely makes sense, since the forward buffered stream cache amount consists of data not read by the demuxer yet. (If the demuxer cache has buffered the full stream, the forward buffered stream cache amount is 0.)
Diffstat (limited to 'player/osd.c')
-rw-r--r--player/osd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/player/osd.c b/player/osd.c
index 9477dd3f38..e9fda355c4 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -261,11 +261,12 @@ static void term_osd_print_status_lazy(struct MPContext *mpctx)
} else {
saddf(&line, "%2ds", (int)s.ts_duration);
}
- if (info.size > 0) {
- if (info.fill >= 1024 * 1024) {
- saddf(&line, "+%lldMB", (long long)(info.fill / 1024 / 1024));
+ int64_t cache_size = s.fw_bytes + info.fill;
+ if (cache_size > 0) {
+ if (cache_size >= 1024 * 1024) {
+ saddf(&line, "+%lldMB", (long long)(cache_size / 1024 / 1024));
} else {
- saddf(&line, "+%lldKB", (long long)(info.fill / 1024));
+ saddf(&line, "+%lldKB", (long long)(cache_size / 1024));
}
}
}