Module: wine Branch: master Commit: 037cefc43b228b60d3fc287dfb38427e2aea2086 URL: http://source.winehq.org/git/wine.git/?a=commit;h=037cefc43b228b60d3fc287dfb...
Author: Chris Robinson chris.kcat@gmail.com Date: Sat Jun 23 08:35:16 2012 -0700
quartz: Fix frame length calculation for MPEG audio.
---
dlls/quartz/mpegsplit.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 585851b..a45f401 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) + 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;