wavpack: calculate outsamplesize with audio_format_frame_size()
This commit is contained in:
parent
ef80464c0c
commit
600e132280
@ -158,11 +158,7 @@ wavpack_decode(struct decoder * decoder, WavpackContext *wpc, bool canseek,
|
||||
allsamples = WavpackGetNumSamples(wpc);
|
||||
bytes_per_sample = WavpackGetBytesPerSample(wpc);
|
||||
|
||||
outsamplesize = bytes_per_sample;
|
||||
if (outsamplesize == 3) {
|
||||
outsamplesize = 4;
|
||||
}
|
||||
outsamplesize *= audio_format.channels;
|
||||
outsamplesize = audio_format_frame_size(&audio_format);
|
||||
|
||||
/* wavpack gives us all kind of samples in a 32-bit space */
|
||||
samplesreq = sizeof(chunk) / (4 * audio_format.channels);
|
||||
|
Loading…
Reference in New Issue
Block a user