Commit 037cefc4 authored by Chris Robinson's avatar Chris Robinson Committed by Alexandre Julliard

quartz: Fix frame length calculation for MPEG audio.

parent b2e3e2e9
......@@ -154,11 +154,17 @@ static HRESULT parse_header(BYTE *header, LONGLONG *plen, LONGLONG *pduration)
return E_INVALIDARG;
}
if (layer == 3 || layer == 2)
if (layer == 1)
length = 4 * (12 * bitrate / freqs[freq_index] + padding);
else if (layer == 2)
length = 144 * bitrate / freqs[freq_index] + padding;
else if (layer == 3)
length = 144 * bitrate / (freqs[freq_index]<<lsf) + padding;
else
length = 4 * (12 * bitrate / freqs[freq_index] + padding);
{
ERR("Impossible layer %d\n", layer);
return E_INVALIDARG;
}
duration = (ULONGLONG)10000000 * (ULONGLONG)(length) / (ULONGLONG)(bitrate/8);
*plen = length;
......
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