diff options
author | Andrey Morozov <morozov.andrey.vmk@gmail.com> | 2014-07-02 02:14:30 +0400 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-02 01:28:11 +0200 |
commit | b1969c0ebabac517ec2b428cd5374186e461ff10 (patch) | |
tree | ede602f321aa94f5a738e1777a748427471e4190 /player/misc.c | |
parent | 9fee8fd3b3b319908861d8f41c4342d746aecc04 (diff) | |
download | mpv-b1969c0ebabac517ec2b428cd5374186e461ff10.tar.bz2 mpv-b1969c0ebabac517ec2b428cd5374186e461ff10.tar.xz |
command: change cache perentage to float, add cache-free and cache-used
Diffstat (limited to 'player/misc.c')
-rw-r--r-- | player/misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/misc.c b/player/misc.c index a5ed361ded..1e22e4e097 100644 --- a/player/misc.c +++ b/player/misc.c @@ -119,7 +119,7 @@ double get_start_time(struct MPContext *mpctx) return demuxer_get_start_time(demuxer); } -int mp_get_cache_percent(struct MPContext *mpctx) +float mp_get_cache_percent(struct MPContext *mpctx) { if (mpctx->stream) { int64_t size = -1; @@ -127,7 +127,7 @@ int mp_get_cache_percent(struct MPContext *mpctx) stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_SIZE, &size); stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &fill); if (size > 0 && fill >= 0) - return fill / (size / 100); + return fill / (size / 100.0); } return -1; } |