decoder/flac: use frame header instead of audio_format
When calculating the properties of the frame, use sample_rate and other information from the frame header instead of the stored audio_format object.
This commit is contained in:
parent
5b2d32b499
commit
3973aeecd2
@ -121,13 +121,13 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
|
|||||||
|
|
||||||
buffer = pcm_buffer_get(&data->buffer, buffer_size);
|
buffer = pcm_buffer_get(&data->buffer, buffer_size);
|
||||||
|
|
||||||
flac_convert(buffer, data->audio_format.channels,
|
flac_convert(buffer, frame->header.channels,
|
||||||
data->audio_format.bits, buf,
|
frame->header.bits_per_sample, buf,
|
||||||
0, frame->header.blocksize);
|
0, frame->header.blocksize);
|
||||||
|
|
||||||
if (data->next_frame >= data->first_frame)
|
if (data->next_frame >= data->first_frame)
|
||||||
position = (float)(data->next_frame - data->first_frame) /
|
position = (float)(data->next_frame - data->first_frame) /
|
||||||
data->audio_format.sample_rate;
|
frame->header.sample_rate;
|
||||||
else
|
else
|
||||||
position = 0;
|
position = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user