# HG changeset patch
# User bcoudurier
# Date 1204718552 0
# Node ID 3dade22abed604e9dcb22145c0db06afea692d1b
# Parent  20e070d8706fe50708f3583d0a05d32601218344
correctly compute bit rate for compressed audio, should fix seeking in aiff

diff -r 20e070d8706f -r 3dade22abed6 aiff.c
--- a/aiff.c	Tue Mar 04 01:31:15 2008 +0000
+++ b/aiff.c	Wed Mar 05 12:02:32 2008 +0000
@@ -152,7 +152,8 @@
     if (!codec->block_align)
         codec->block_align = (codec->bits_per_sample * codec->channels) >> 3;
 
-    codec->bit_rate = codec->sample_rate * (codec->block_align << 3);
+    codec->bit_rate = (codec->frame_size ? codec->sample_rate/codec->frame_size :
+                       codec->sample_rate) * (codec->block_align << 3);
 
     /* Chunk is over */
     if (size)