diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-17 20:12:22 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-17 20:12:22 +0100 |
commit | faca996ed66ef665f419087192381077c90b6995 (patch) | |
tree | 309e2c33af6cbc4f5cdf60838bd0b126fa57c44d /plugins | |
parent | 6814d91504c04dfe2e1e5876d19cf5625e5de926 (diff) |
ffmpeg: Fix bitrate calculation (bug #1052)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index efedb7bd..1cc6564a 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -442,10 +442,9 @@ ffmpeg_read (DB_fileinfo_t *_info, char *bytes, int size) { if (info->pkt.duration > 0) { AVRational *time_base = &info->fctx->streams[info->stream_id]->time_base; float sec = (float)info->pkt.duration * time_base->num / time_base->den; - int bitrate = info->pkt.size/sec; + int bitrate = info->pkt.size * 8 / sec; if (bitrate > 0) { - // FIXME: seems like duration translation is wrong - deadbeef->streamer_set_bitrate (bitrate / 100); + deadbeef->streamer_set_bitrate (bitrate / 1000); } } |