Zebediah Figura : quartz/waveparser: Ignore unsupported chunks when connecting.
Alexandre Julliard
julliard at winehq.org
Mon Mar 4 15:08:24 CST 2019
Module: wine
Branch: master
Commit: 0e4acebb7ef3e88a2894711cf1b5e95b4a9549d9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0e4acebb7ef3e88a2894711cf1b5e95b4a9549d9
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sun Mar 3 20:11:49 2019 -0600
quartz/waveparser: Ignore unsupported chunks when connecting.
In particular, the test file just added contains 'LIST' chunks.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 db9c3bd..be31c92 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 834b634..609f192 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));
More information about the wine-cvs
mailing list