Fixed bitrate calculation.

CQTexperiment
vspader 2008-02-20 01:09:15 +00:00
parent 86a63b1efc
commit a54f6ecfe5
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@
int samplesPerMPEGFrame = 0; int samplesPerMPEGFrame = 0;
int id3_length = 0; int id3_length = 0;
mad_stream_init (&stream); mad_stream_init (&stream);
mad_frame_init (&frame); mad_frame_init (&frame);
@ -271,7 +271,7 @@
} }
} }
bitrate = (((_fileSize - id3_length)*8)/1000) * (sampleRate/totalFrames); bitrate = ((double)((_fileSize - id3_length)*8)/1000.0) * (sampleRate/(double)totalFrames);
mad_frame_finish (&frame); mad_frame_finish (&frame);
mad_stream_finish (&stream); mad_stream_finish (&stream);