summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-01 20:25:27 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-01 20:25:27 +0200
commit2dd0e4e667b016d58fa601180b76a1b60a23cac1 (patch)
treecb6d04022a8329453bbcd04b203922a951885064 /plugins/mpgmad
parent8fb55282007c5f68ea58220eb3b7d085f36d11c7 (diff)
mp3: fixed constant bitrate calculation when xing frame exists
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c5
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;
+ }
}
}
}