Commit 600e1322 authored by Max Kellermann's avatar Max Kellermann

wavpack: calculate outsamplesize with audio_format_frame_size()

parent ef80464c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment