summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-03 04:01:31 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-03 04:01:31 +0000
commit73bcce335f49df5b919ba326765a94fd821561ea (patch)
tree695acf526cf42188b7d24eac51b938ff63b5f904 /src
parent785cdb0114f8cf534ef93e413e49fbfb62521a67 (diff)
when converting from bps -> kbps, divide by 1000, not 1024
git-svn-id: https://svn.musicpd.org/mpd/trunk@592 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/aac_decode.c2
-rw-r--r--src/audiofile_decode.c2
-rw-r--r--src/flac_decode.c2
-rw-r--r--src/mp3_decode.c2
-rw-r--r--src/mp4_decode.c2
-rw-r--r--src/ogg_decode.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/src/aac_decode.c b/src/aac_decode.c
index 0610b774a..1c0f867d9 100644
--- a/src/aac_decode.c
+++ b/src/aac_decode.c
@@ -357,7 +357,7 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(sampleCount>0) {
bitRate = frameInfo.bytesconsumed*8.0*
frameInfo.channels*sampleRate/
- frameInfo.samples/1024+0.5;
+ frameInfo.samples/1000+0.5;
time+= (float)(frameInfo.samples)/frameInfo.channels/
sampleRate;
}
diff --git a/src/audiofile_decode.c b/src/audiofile_decode.c
index d34c029ee..7cd193581 100644
--- a/src/audiofile_decode.c
+++ b/src/audiofile_decode.c
@@ -79,7 +79,7 @@ int audiofile_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
cb->totalTime = ((float)frame_count/(float)af->sampleRate);
- bitRate = st.st_size*8.0/cb->totalTime/1024.0+0.5;
+ bitRate = st.st_size*8.0/cb->totalTime/1000.0+0.5;
if (af->bits != 8 && af->bits != 16) {
ERROR("Only 8 and 16-bit files are supported. %s is %i-bit\n",
diff --git a/src/flac_decode.c b/src/flac_decode.c
index afb5bcf74..25857cb6e 100644
--- a/src/flac_decode.c
+++ b/src/flac_decode.c
@@ -219,7 +219,7 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__FileDecoder *dec, const FLA
FLAC__file_decoder_get_decode_position(dec,&newPosition);
if(data->position) {
data->bitRate = ((newPosition-data->position)*8.0/timeChange)
- /1024+0.5;
+ /1000+0.5;
}
data->position = newPosition;
diff --git a/src/mp3_decode.c b/src/mp3_decode.c
index 618f6f5ef..84192078b 100644
--- a/src/mp3_decode.c
+++ b/src/mp3_decode.c
@@ -416,7 +416,7 @@ int mp3ChildSendData(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
memcpy(cb->chunks+cb->end*CHUNK_SIZE,data->outputBuffer,CHUNK_SIZE);
cb->chunkSize[cb->end] = data->outputPtr-data->outputBuffer;
- cb->bitRate[cb->end] = data->bitRate/1024;
+ cb->bitRate[cb->end] = data->bitRate/1000;
cb->times[cb->end] = data->elapsedTime;
cb->end++;
diff --git a/src/mp4_decode.c b/src/mp4_decode.c
index 73e99215a..77e98b676 100644
--- a/src/mp4_decode.c
+++ b/src/mp4_decode.c
@@ -270,7 +270,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
initial =0;
bitRate = frameInfo.bytesconsumed*8.0*
frameInfo.channels*scale/
- frameInfo.samples/1024+0.5;
+ frameInfo.samples/1000+0.5;
}
diff --git a/src/ogg_decode.c b/src/ogg_decode.c
index e5a9d58d5..ef74637d9 100644
--- a/src/ogg_decode.c
+++ b/src/ogg_decode.c
@@ -122,7 +122,7 @@ int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
chunkpos = 0;
cb->times[cb->end] = ov_time_tell(&vf);
if((test = ov_bitrate_instant(&vf))>0) {
- bitRate = test/1024;
+ bitRate = test/1000;
}
cb->bitRate[cb->end] = bitRate;
cb->end++;