Chris Robinson : quartz: Fix frame length calculation for MPEG audio.

Alexandre Julliard julliard at winehq.org
Mon Jun 25 13:24:10 CDT 2012


Module: wine
Branch: master
Commit: 037cefc43b228b60d3fc287dfb38427e2aea2086
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=037cefc43b228b60d3fc287dfb38427e2aea2086

Author: Chris Robinson <chris.kcat at 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;




More information about the wine-cvs mailing list