diff options
author | waker <wakeroid@gmail.com> | 2011-04-01 20:25:27 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-01 20:25:27 +0200 |
commit | 2dd0e4e667b016d58fa601180b76a1b60a23cac1 (patch) | |
tree | cb6d04022a8329453bbcd04b203922a951885064 /plugins/mpgmad | |
parent | 8fb55282007c5f68ea58220eb3b7d085f36d11c7 (diff) |
mp3: fixed constant bitrate calculation when xing frame exists
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r-- | plugins/mpgmad/mpgmad.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c index 9e51ae6d..54f57ffd 100644 --- a/plugins/mpgmad/mpgmad.c +++ b/plugins/mpgmad/mpgmad.c @@ -522,7 +522,10 @@ cmp3_scan_stream (buffer_t *buffer, int sample) { if (fsize >= 0) { buffer->bitrate = (fsize - deadbeef->ftell (buffer->file))/ buffer->samplerate * 1000; } - return 0; + if (buffer->vbr != DETECTED_VBR && buffer->vbr != XING_CBR) { + // let's don't trust xing header on constant bitrate value, and calculate it ourselves + return 0; + } } } } |