[PATCH 4/5] quartz/waveparser: Ignore unsupported chunks when connecting.

Zebediah Figura z.figura12 at gmail.com
Sun Mar 3 20:11:49 CST 2019


In particular, the test file just added contains 'LIST' chunks.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/quartz/quartz_private.h |  8 ++++++++
 dlls/quartz/waveparser.c     | 18 ++++++------------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h
index db9c3bdc8a..be31c92946 100644
--- a/dlls/quartz/quartz_private.h
+++ b/dlls/quartz/quartz_private.h
@@ -30,9 +30,17 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "dshow.h"
+#include "wine/debug.h"
 #include "wine/strmbase.h"
 #include "wine/list.h"
 
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+    if (!fourcc) return "''";
+    return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+            (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
+
 /* see IAsyncReader::Request on MSDN for the explanation of this */
 #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000)
 #define SEC_FROM_MEDIATIME(time) ((time) / 10000000)
diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c
index 834b6344d2..609f192820 100644
--- a/dlls/quartz/waveparser.c
+++ b/dlls/quartz/waveparser.c
@@ -296,20 +296,14 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
 
     pos += chunk.cb;
     hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(chunk), (BYTE *)&chunk);
-    if (chunk.fcc == mmioFOURCC('f','a','c','t'))
+    while (chunk.fcc != mmioFOURCC('d','a','t','a'))
     {
-        FIXME("'fact' chunk not supported yet\n");
-	pos += sizeof(chunk) + chunk.cb;
-	hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(chunk), (BYTE *)&chunk);
+        FIXME("Ignoring %s chunk.\n", debugstr_fourcc(chunk.fcc));
+        pos += sizeof(chunk) + chunk.cb;
+        hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(chunk), (BYTE *)&chunk);
+        if (hr != S_OK)
+            return E_FAIL;
     }
-    if (chunk.fcc != mmioFOURCC('d','a','t','a'))
-    {
-        ERR("Expected 'data' chunk, but got %.04s\n", (LPSTR)&chunk.fcc);
-        return E_FAIL;
-    }
-
-    if (hr != S_OK)
-        return E_FAIL;
 
     pWAVEParser->StartOfFile = MEDIATIME_FROM_BYTES(pos + sizeof(RIFFCHUNK));
     pWAVEParser->EndOfFile = MEDIATIME_FROM_BYTES(pos + chunk.cb + sizeof(RIFFCHUNK));
-- 
2.20.1




More information about the wine-devel mailing list