From b1969c0ebabac517ec2b428cd5374186e461ff10 Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Wed, 2 Jul 2014 02:14:30 +0400 Subject: command: change cache perentage to float, add cache-free and cache-used --- player/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/misc.c') 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; } -- cgit v1.2.3