From 11f5713e3bbeea8449a97ecb979936e02660321e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 24 Jan 2018 01:32:56 +0100 Subject: options: add an option type for byte sizes And use it for 2 demuxer options. It could be used for more options later. (Though the --cache options can not use this, because they use KB as base unit.) --- player/command.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index c6f23eb9bf..7b36dcd7a2 100644 --- a/player/command.c +++ b/player/command.c @@ -320,24 +320,6 @@ static char *cut_osd_list(struct MPContext *mpctx, char *text, int pos) return new; } -static char *format_file_size(int64_t size) -{ - double s = size; - if (size < 1024) - return talloc_asprintf(NULL, "%.0f", s); - - if (size < (1024 * 1024)) - return talloc_asprintf(NULL, "%.3f KiB", s / (1024.0)); - - if (size < (1024 * 1024 * 1024)) - return talloc_asprintf(NULL, "%.3f MiB", s / (1024.0 * 1024.0)); - - if (size < (1024LL * 1024LL * 1024LL * 1024LL)) - return talloc_asprintf(NULL, "%.3f GiB", s / (1024.0 * 1024.0 * 1024.0)); - - return talloc_asprintf(NULL, "%.3f TiB", s / (1024.0 * 1024.0 * 1024.0 * 1024.0)); -} - static char *format_delay(double time) { return talloc_asprintf(NULL, "%d ms", (int)lrint(time * 1000)); -- cgit v1.2.3