summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorAndrey Morozov <morozov.andrey.vmk@gmail.com>2014-05-07 15:55:02 -0300
committerwm4 <wm4@nowhere>2014-06-01 17:27:17 +0200
commitb5e40e15a3e35f0b48345b949a86f8862bca3b8b (patch)
tree73b3757f5839a44e2597dd524a68e25fc515db35 /player
parentae09c0d8ebdf77beed10b35155bde776fe4b6866 (diff)
downloadmpv-b5e40e15a3e35f0b48345b949a86f8862bca3b8b.tar.bz2
mpv-b5e40e15a3e35f0b48345b949a86f8862bca3b8b.tar.xz
command: improve video-bitrate property
Signed-off-by: wm4 <wm4@nowhere> Includes some cosmetic changes over the original PR.
Diffstat (limited to 'player')
-rw-r--r--player/command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 35738e1efb..6f1a769a20 100644
--- a/player/command.c
+++ b/player/command.c
@@ -105,7 +105,10 @@ static void mark_seek(struct MPContext *mpctx)
static char *format_bitrate(int rate)
{
- return talloc_asprintf(NULL, "%d kbps", rate / 1000);
+ if (rate < 1024 * 1024)
+ return talloc_asprintf(NULL, "%.3f kbps", rate * 8.0 / 1000.0);
+
+ return talloc_asprintf(NULL, "%.3f mbps", rate * 8.0 / 1000000.0);
}
static char *format_file_size(int64_t size)