From 037cefc43b228b60d3fc287dfb38427e2aea2086 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 23 Jun 2012 08:35:16 -0700 Subject: [PATCH] quartz: Fix frame length calculation for MPEG audio. --- dlls/quartz/mpegsplit.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 585851b2647..a45f40124fb 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -154,11 +154,17 @@ static HRESULT parse_header(BYTE *header, LONGLONG *plen, LONGLONG *pduration) return E_INVALIDARG; } - - if (layer == 3 || layer == 2) - length = 144 * bitrate / freqs[freq_index] + padding; - else + 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]<