decoder/{dsf,dsdiff}: precalculate bit rate

This commit is contained in:
Max Kellermann
2019-09-08 12:52:02 +02:00
parent 0da9c91af2
commit bf49c9e4e2
2 changed files with 4 additions and 2 deletions

View File

@@ -256,6 +256,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is,
offset_type n_blocks,
bool bitreverse)
{
const unsigned kbit_rate = channels * sample_rate / 1000;
const size_t block_size = channels * DSF_BLOCK_SIZE;
const offset_type start_offset = is.GetOffset();
@@ -291,7 +292,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is,
cmd = client.SubmitData(is,
interleaved_buffer, block_size,
channels * sample_rate / 1000);
kbit_rate);
++i;
}