summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-24 01:32:56 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-25 20:18:32 -0800
commit11f5713e3bbeea8449a97ecb979936e02660321e (patch)
treeea8ee4886ca914a9185b0b2bd9bee68fd011869c /player
parentcabfbc34b539c06ae37745a200996bd351b64cf5 (diff)
downloadmpv-11f5713e3bbeea8449a97ecb979936e02660321e.tar.bz2
mpv-11f5713e3bbeea8449a97ecb979936e02660321e.tar.xz
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.)
Diffstat (limited to 'player')
-rw-r--r--player/command.c18
1 files changed, 0 insertions, 18 deletions
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));