command: format_bitrate: fix conversion to kbits and mbits

Bitrates are now expressed in bits/second. This commit fixes conversions
which assumed it was still in bytes/second.

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
Marcoen Hirschberg 2014-06-02 14:19:56 +02:00 committed by wm4
parent d838bd6420
commit af25e0aba8
1 changed files with 2 additions and 2 deletions

View File

@ -106,9 +106,9 @@ static void mark_seek(struct MPContext *mpctx)
static char *format_bitrate(int rate) static char *format_bitrate(int rate)
{ {
if (rate < 1024 * 1024) if (rate < 1024 * 1024)
return talloc_asprintf(NULL, "%.3f kbps", rate * 8.0 / 1000.0); return talloc_asprintf(NULL, "%.3f kbps", rate / 1000.0);
return talloc_asprintf(NULL, "%.3f mbps", rate * 8.0 / 1000000.0); return talloc_asprintf(NULL, "%.3f mbps", rate / 1000000.0);
} }
static char *format_file_size(int64_t size) static char *format_file_size(int64_t size)