https://git.reactos.org/?p=reactos.git;a=commitdiff;h=83d28845a1232edb1009cb48f60a9d942284d3d1

commit 83d28845a1232edb1009cb48f60a9d942284d3d1
Author:     Amine Khaldi <[email protected]>
AuthorDate: Thu Mar 8 13:46:24 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Thu Mar 8 13:46:24 2018 +0100

    [QUARTZ] Sync with Wine Staging 3.3. CORE-14434
---
 dll/directx/wine/quartz/CMakeLists.txt   |   4 +-
 dll/directx/wine/quartz/acmwrapper.c     |  19 +++++
 dll/directx/wine/quartz/avidec.c         |  20 +++++
 dll/directx/wine/quartz/avisplit.c       |  17 ++++
 dll/directx/wine/quartz/dsoundrender.c   |  18 +++++
 dll/directx/wine/quartz/enumfilters.c    |   4 +
 dll/directx/wine/quartz/enummedia.c      |   4 +
 dll/directx/wine/quartz/enummoniker.c    |   6 ++
 dll/directx/wine/quartz/enumregfilters.c |   6 ++
 dll/directx/wine/quartz/filesource.c     |  15 ++++
 dll/directx/wine/quartz/filtergraph.c    | 133 ++++++++++++++++++-------------
 dll/directx/wine/quartz/filtermapper.c   |  23 +++++-
 dll/directx/wine/quartz/main.c           |   6 ++
 dll/directx/wine/quartz/memallocator.c   |  11 ++-
 dll/directx/wine/quartz/mpegsplit.c      |  16 +++-
 dll/directx/wine/quartz/nullrenderer.c   |  18 +++++
 dll/directx/wine/quartz/parser.c         |  20 ++++-
 dll/directx/wine/quartz/pin.c            |  19 +++--
 dll/directx/wine/quartz/precomp.h        |  29 +++++++
 dll/directx/wine/quartz/quartz_private.h |  35 ++------
 dll/directx/wine/quartz/regsvr.c         |  24 +++++-
 dll/directx/wine/quartz/systemclock.c    |   8 +-
 dll/directx/wine/quartz/videorenderer.c  |  20 +++++
 dll/directx/wine/quartz/vmr9.c           |  22 ++++-
 dll/directx/wine/quartz/waveparser.c     |  16 ++++
 media/doc/README.WINE                    |   2 +-
 26 files changed, 413 insertions(+), 102 deletions(-)

diff --git a/dll/directx/wine/quartz/CMakeLists.txt 
b/dll/directx/wine/quartz/CMakeLists.txt
index d750daef6d..8c12e38b85 100644
--- a/dll/directx/wine/quartz/CMakeLists.txt
+++ b/dll/directx/wine/quartz/CMakeLists.txt
@@ -35,7 +35,7 @@ list(APPEND SOURCE
     videorenderer.c
     vmr9.c
     waveparser.c
-    quartz_private.h)
+    precomp.h)
 
 add_library(quartz SHARED
     ${SOURCE}
@@ -57,5 +57,5 @@ set_module_type(quartz win32dll)
 target_link_libraries(quartz strmbase strmiids uuid dxguid wine ${PSEH_LIB})
 add_importlibs(quartz dsound msacm32 msvfw32 ole32 oleaut32 rpcrt4 user32 
gdi32 advapi32 advapi32_vista shlwapi msvcrt kernel32 ntdll)
 add_dependencies(quartz dxsdk quartz_idlheader stdole2)
-add_pch(quartz quartz_private.h SOURCE)
+add_pch(quartz precomp.h SOURCE)
 add_cd_file(TARGET quartz DESTINATION reactos/system32 FOR all)
diff --git a/dll/directx/wine/quartz/acmwrapper.c 
b/dll/directx/wine/quartz/acmwrapper.c
index 686a23190f..3c1c7cffaa 100644
--- a/dll/directx/wine/quartz/acmwrapper.c
+++ b/dll/directx/wine/quartz/acmwrapper.c
@@ -18,7 +18,26 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "mmreg.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "strmif.h"
+#include "vfwmsgs.h"
+#include "msacm.h"
+
+#include <assert.h>
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct ACMWrapperImpl
 {
diff --git a/dll/directx/wine/quartz/avidec.c b/dll/directx/wine/quartz/avidec.c
index 11964f4025..c9ca7606a5 100644
--- a/dll/directx/wine/quartz/avidec.c
+++ b/dll/directx/wine/quartz/avidec.c
@@ -18,7 +18,27 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "amvideo.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "strmif.h"
+#include "vfwmsgs.h"
+#include "vfw.h"
+#include "dvdmedia.h"
+
+#include <assert.h>
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct AVIDecImpl
 {
diff --git a/dll/directx/wine/quartz/avisplit.c 
b/dll/directx/wine/quartz/avisplit.c
index 0f5c2d72ed..f3eccedcfc 100644
--- a/dll/directx/wine/quartz/avisplit.c
+++ b/dll/directx/wine/quartz/avisplit.c
@@ -30,6 +30,21 @@
  */
 
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "vfw.h"
+#include "aviriff.h"
+#include "vfwmsgs.h"
+#include "amvideo.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+#include <math.h>
+#include <assert.h>
+
+#include "parser.h"
 
 #define TWOCCFromFOURCC(fcc) HIWORD(fcc)
 
@@ -37,6 +52,8 @@
 #define ckidINFO       mmioFOURCC('I','N','F','O')
 #define ckidREC        mmioFOURCC('R','E','C',' ')
 
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 typedef struct StreamData
 {
     DWORD dwSampleSize;
diff --git a/dll/directx/wine/quartz/dsoundrender.c 
b/dll/directx/wine/quartz/dsoundrender.c
index 35daaefa79..7902955481 100644
--- a/dll/directx/wine/quartz/dsoundrender.c
+++ b/dll/directx/wine/quartz/dsoundrender.c
@@ -18,7 +18,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "evcode.h"
+#include "strmif.h"
+#include "dsound.h"
+#include "amaudio.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 /* NOTE: buffer can still be filled completely,
  * but we start waiting until only this amount is buffered
diff --git a/dll/directx/wine/quartz/enumfilters.c 
b/dll/directx/wine/quartz/enumfilters.c
index ea19f4e085..331991b84c 100644
--- a/dll/directx/wine/quartz/enumfilters.c
+++ b/dll/directx/wine/quartz/enumfilters.c
@@ -20,6 +20,10 @@
 
 #include "quartz_private.h"
 
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 typedef struct IEnumFiltersImpl
 {
     IEnumFilters IEnumFilters_iface;
diff --git a/dll/directx/wine/quartz/enummedia.c 
b/dll/directx/wine/quartz/enummedia.c
index 32b42a6bd6..b3acc5d4e2 100644
--- a/dll/directx/wine/quartz/enummedia.c
+++ b/dll/directx/wine/quartz/enummedia.c
@@ -20,6 +20,10 @@
 
 #include "quartz_private.h"
 
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt)
 {
     if (!pmt)
diff --git a/dll/directx/wine/quartz/enummoniker.c 
b/dll/directx/wine/quartz/enummoniker.c
index a90e6a4ead..c0071a3360 100644
--- a/dll/directx/wine/quartz/enummoniker.c
+++ b/dll/directx/wine/quartz/enummoniker.c
@@ -18,8 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define COBJMACROS
+
 #include "quartz_private.h"
 
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 typedef struct EnumMonikerImpl
 {
     IEnumMoniker IEnumMoniker_iface;
diff --git a/dll/directx/wine/quartz/enumregfilters.c 
b/dll/directx/wine/quartz/enumregfilters.c
index 033299b1d4..a116063268 100644
--- a/dll/directx/wine/quartz/enumregfilters.c
+++ b/dll/directx/wine/quartz/enumregfilters.c
@@ -20,6 +20,12 @@
 
 #include "quartz_private.h"
 
+#include "wine/unicode.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 typedef struct IEnumRegFiltersImpl
 {
     IEnumRegFilters IEnumRegFilters_iface;
diff --git a/dll/directx/wine/quartz/filesource.c 
b/dll/directx/wine/quartz/filesource.c
index 39227a1747..4290ac351d 100644
--- a/dll/directx/wine/quartz/filesource.c
+++ b/dll/directx/wine/quartz/filesource.c
@@ -18,8 +18,23 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
 #include "quartz_private.h"
 
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "pin.h"
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include <assert.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 };
 
 typedef struct AsyncReader
diff --git a/dll/directx/wine/quartz/filtergraph.c 
b/dll/directx/wine/quartz/filtergraph.c
index b6538ab16c..f482d4ef38 100644
--- a/dll/directx/wine/quartz/filtergraph.c
+++ b/dll/directx/wine/quartz/filtergraph.c
@@ -18,7 +18,28 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include "dshow.h"
+#include "wine/debug.h"
 #include "quartz_private.h"
+#include "ole2.h"
+#include "olectl.h"
+#include "strmif.h"
+#include "vfwmsgs.h"
+#include "evcode.h"
+#include "wine/unicode.h"
+
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct {
     HWND     hWnd;      /* Target window */
@@ -179,7 +200,6 @@ typedef struct _IFilterGraphImpl {
     GUID timeformatseek;
     REFERENCE_TIME start_time;
     REFERENCE_TIME pause_time;
-    LONGLONG stop_position;
     LONG recursioncount;
     IUnknown *pSite;
     LONG version;
@@ -1028,6 +1048,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 
*iface, IPin *ppinOut,
         if (IsEqualGUID(&clsid, &FilterCLSID)) {
             /* Skip filter (same as the one the output pin belongs to) */
             IBaseFilter_Release(pfilter);
+            pfilter = NULL;
             goto error;
         }
 
@@ -2458,52 +2479,6 @@ static HRESULT WINAPI 
MediaSeeking_GetDuration(IMediaSeeking *iface, LONGLONG *p
     return hr;
 }
 
-static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, 
LONGLONG *pStop)
-{
-    IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
-    HRESULT hr = S_OK;
-
-    TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
-
-    if (!pStop)
-        return E_POINTER;
-
-    EnterCriticalSection(&This->cs);
-    if (This->stop_position < 0)
-        /* Stop position not set, use duration instead */
-        hr = IMediaSeeking_GetDuration(iface, pStop);
-    else
-        *pStop = This->stop_position;
-    LeaveCriticalSection(&This->cs);
-
-    return hr;
-}
-
-static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, 
LONGLONG *pCurrent)
-{
-    IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
-    LONGLONG time = 0;
-
-    if (!pCurrent)
-        return E_POINTER;
-
-    EnterCriticalSection(&This->cs);
-    if (This->state == State_Running && This->refClock && This->start_time >= 
0)
-    {
-        IReferenceClock_GetTime(This->refClock, &time);
-        if (time)
-            time -= This->start_time;
-    }
-    if (This->pause_time > 0)
-        time += This->pause_time;
-    *pCurrent = time;
-    LeaveCriticalSection(&This->cs);
-
-    TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent 
/ 10000)%1000));
-
-    return S_OK;
-}
-
 static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, 
LONGLONG *pTarget,
         const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
 {
@@ -2556,11 +2531,6 @@ static HRESULT WINAPI 
MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *
         (dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning)
         FIXME("Adjust method %x not handled yet!\n", dwCurrentFlags & 0x7);
 
-    if ((dwStopFlags & 0x7) == AM_SEEKING_AbsolutePositioning)
-        This->stop_position = *pStop;
-    else if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning)
-        FIXME("Stop position not handled yet!\n");
-
     if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush))
         IMediaControl_Pause(&This->IMediaControl_iface);
     args.current = pCurrent;
@@ -2578,16 +2548,68 @@ static HRESULT WINAPI 
MediaSeeking_SetPositions(IMediaSeeking *iface, LONGLONG *
     return hr;
 }
 
+static HRESULT WINAPI found_getposition(IFilterGraphImpl *This, IMediaSeeking 
*seek, DWORD_PTR pargs)
+{
+    struct pos_args *args = (void*)pargs;
+
+    return IMediaSeeking_GetPositions(seek, args->current, args->stop);
+}
+
 static HRESULT WINAPI MediaSeeking_GetPositions(IMediaSeeking *iface, LONGLONG 
*pCurrent,
         LONGLONG *pStop)
 {
     IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
+    struct pos_args args;
+    LONGLONG time = 0;
     HRESULT hr;
 
     TRACE("(%p/%p)->(%p, %p)\n", This, iface, pCurrent, pStop);
-    hr = IMediaSeeking_GetCurrentPosition(iface, pCurrent);
-    if (SUCCEEDED(hr))
-        hr = IMediaSeeking_GetStopPosition(iface, pStop);
+
+    args.current = pCurrent;
+    args.stop = pStop;
+    EnterCriticalSection(&This->cs);
+    hr = all_renderers_seek(This, found_getposition, (DWORD_PTR)&args);
+    if (This->state == State_Running && This->refClock && This->start_time >= 
0)
+    {
+        IReferenceClock_GetTime(This->refClock, &time);
+        if (time)
+            time -= This->start_time;
+    }
+    if (This->pause_time > 0)
+        time += This->pause_time;
+    *pCurrent += time;
+    LeaveCriticalSection(&This->cs);
+
+    return hr;
+}
+
+static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, 
LONGLONG *pCurrent)
+{
+    LONGLONG time;
+    HRESULT hr;
+
+    if (!pCurrent)
+        return E_POINTER;
+
+    hr = MediaSeeking_GetPositions(iface, pCurrent, &time);
+
+    TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent 
/ 10000)%1000));
+
+    return hr;
+}
+
+static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, 
LONGLONG *pStop)
+{
+    IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
+    LONGLONG time;
+    HRESULT hr;
+
+    TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
+
+    if (!pStop)
+        return E_POINTER;
+
+    hr = MediaSeeking_GetPositions(iface, &time, pStop);
 
     return hr;
 }
@@ -5713,7 +5735,6 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID 
*ppObj)
     fimpl->nItfCacheEntries = 0;
     memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID));
     fimpl->start_time = fimpl->pause_time = 0;
-    fimpl->stop_position = -1;
     fimpl->punkFilterMapper2 = NULL;
     fimpl->recursioncount = 0;
     fimpl->version = 0;
diff --git a/dll/directx/wine/quartz/filtermapper.c 
b/dll/directx/wine/quartz/filtermapper.c
index 98d3cab92a..2dd316d877 100644
--- a/dll/directx/wine/quartz/filtermapper.c
+++ b/dll/directx/wine/quartz/filtermapper.c
@@ -19,10 +19,29 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winerror.h"
+
 #include "quartz_private.h"
 
-#include <initguid.h>
-#include <fil_data.h>
+#include "ole2.h"
+#include "olectl.h"
+#include "strmif.h"
+#include "wine/unicode.h"
+#include "uuids.h"
+#include "initguid.h"
+#include "fil_data.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 #undef ARRAYSIZE
 #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
diff --git a/dll/directx/wine/quartz/main.c b/dll/directx/wine/quartz/main.c
index 5b373d5ab0..7c2accb9b2 100644
--- a/dll/directx/wine/quartz/main.c
+++ b/dll/directx/wine/quartz/main.c
@@ -17,7 +17,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include "wine/debug.h"
+
 #include "quartz_private.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *) 
DECLSPEC_HIDDEN;
 extern HRESULT WINAPI QUARTZ_DllCanUnloadNow(void) DECLSPEC_HIDDEN;
diff --git a/dll/directx/wine/quartz/memallocator.c 
b/dll/directx/wine/quartz/memallocator.c
index 10aab46c27..f5ee3c29ef 100644
--- a/dll/directx/wine/quartz/memallocator.c
+++ b/dll/directx/wine/quartz/memallocator.c
@@ -18,9 +18,18 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+#include <limits.h>
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "vfwmsgs.h"
+
 #include "quartz_private.h"
+#include "wine/debug.h"
 
-#include <wine/list.h>
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct StdMediaSample2
 {
diff --git a/dll/directx/wine/quartz/mpegsplit.c 
b/dll/directx/wine/quartz/mpegsplit.c
index 8d108f5382..c78046fff3 100644
--- a/dll/directx/wine/quartz/mpegsplit.c
+++ b/dll/directx/wine/quartz/mpegsplit.c
@@ -21,10 +21,24 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+#include <math.h>
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "mmreg.h"
+#include "mmsystem.h"
+
+#include "wine/winternl.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
 
-#include <strmif.h>
+#include "parser.h"
 
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 #define SEQUENCE_HEADER_CODE     0xB3
 #define PACK_START_CODE          0xBA
diff --git a/dll/directx/wine/quartz/nullrenderer.c 
b/dll/directx/wine/quartz/nullrenderer.c
index 432749a976..eccdfc6757 100644
--- a/dll/directx/wine/quartz/nullrenderer.c
+++ b/dll/directx/wine/quartz/nullrenderer.c
@@ -19,7 +19,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include "amvideo.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "evcode.h"
+#include "strmif.h"
+#include "ddraw.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct NullRendererImpl
 {
diff --git a/dll/directx/wine/quartz/parser.c b/dll/directx/wine/quartz/parser.c
index 6f46ed7339..4b968a398c 100644
--- a/dll/directx/wine/quartz/parser.c
+++ b/dll/directx/wine/quartz/parser.c
@@ -20,6 +20,20 @@
  */
 
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "vfwmsgs.h"
+#include "amvideo.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+#include <math.h>
+#include <assert.h>
+
+#include "parser.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
 static const IMediaSeekingVtbl Parser_Seeking_Vtbl;
@@ -143,8 +157,12 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, 
REFIID riid, LPVOID *
         return S_OK;
     }
 
-    if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
+    if (!IsEqualIID(riid, &IID_IPin) &&
+        !IsEqualIID(riid, &IID_IVideoWindow) &&
+        !IsEqualIID(riid, &IID_IAMFilterMiscFlags))
+    {
         FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
+    }
 
     return E_NOINTERFACE;
 }
diff --git a/dll/directx/wine/quartz/pin.c b/dll/directx/wine/quartz/pin.c
index 738b1c0609..5197d5ceb9 100644
--- a/dll/directx/wine/quartz/pin.c
+++ b/dll/directx/wine/quartz/pin.c
@@ -19,6 +19,15 @@
  */
 
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include <assert.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 #define ALIGNDOWN(value,boundary) ((value)/(boundary)*(boundary))
 #define ALIGNUP(value,boundary) (ALIGNDOWN((value)+(boundary)-1, (boundary)))
@@ -532,11 +541,7 @@ static void  PullPin_Thread_Stop(PullPin *This)
     TRACE("(%p)->()\n", This);
 
     EnterCriticalSection(This->pin.pCritSec);
-    {
-        CloseHandle(This->hThread);
-        This->hThread = NULL;
-        SetEvent(This->hEventStateChanged);
-    }
+    SetEvent(This->hEventStateChanged);
     LeaveCriticalSection(This->pin.pCritSec);
 
     IBaseFilter_Release(This->pin.pinInfo.pFilter);
@@ -822,6 +827,10 @@ HRESULT WINAPI PullPin_Disconnect(IPin *iface)
     }
     LeaveCriticalSection(This->pin.pCritSec);
 
+    WaitForSingleObject(This->hThread, INFINITE);
+    CloseHandle(This->hThread);
+    This->hThread = NULL;
+
     return hr;
 }
 
diff --git a/dll/directx/wine/quartz/precomp.h 
b/dll/directx/wine/quartz/precomp.h
new file mode 100644
index 0000000000..5aa2020fd7
--- /dev/null
+++ b/dll/directx/wine/quartz/precomp.h
@@ -0,0 +1,29 @@
+
+#ifndef _QUARTZ_PRECOMP_H_
+#define _QUARTZ_PRECOMP_H_
+
+#include <wine/config.h>
+
+#include <assert.h>
+
+#define WIN32_LEAN_AND_MEAN
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
+#include "quartz_private.h"
+
+#include <dvdmedia.h>
+#include <vfw.h>
+#include <aviriff.h>
+#include <shlwapi.h>
+
+#include <wine/unicode.h>
+#include <wine/debug.h>
+
+#include "pin.h"
+#include "parser.h"
+
+#endif /* !_QUARTZ_PRECOMP_H_ */
diff --git a/dll/directx/wine/quartz/quartz_private.h 
b/dll/directx/wine/quartz/quartz_private.h
index 45565939a1..a9855e95ac 100644
--- a/dll/directx/wine/quartz/quartz_private.h
+++ b/dll/directx/wine/quartz/quartz_private.h
@@ -20,37 +20,18 @@
 #ifndef __QUARTZ_PRIVATE_INCLUDED__
 #define __QUARTZ_PRIVATE_INCLUDED__
 
-#include <wine/config.h>
-
 #include <stdarg.h>
-#include <assert.h>
-
-#define WIN32_LEAN_AND_MEAN
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
 
 #define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
-
-#include <windef.h>
-#include <winbase.h>
-#include <objbase.h>
-#include <dshow.h>
-#include <dvdmedia.h>
-#include <vfw.h>
-#include <aviriff.h>
-#include <shlwapi.h>
-
-#include <wine/strmbase.h>
-#include <wine/unicode.h>
-
-#include <wine/debug.h>
-WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
-#include "pin.h"
-#include "parser.h"
+#include "windef.h"
+#include "winbase.h"
+#include "wtypes.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "dshow.h"
+#include "wine/strmbase.h"
+#include "wine/list.h"
 
 /* see IAsyncReader::Request on MSDN for the explanation of this */
 #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000)
diff --git a/dll/directx/wine/quartz/regsvr.c b/dll/directx/wine/quartz/regsvr.c
index e5b7abc10c..196e0649d8 100644
--- a/dll/directx/wine/quartz/regsvr.c
+++ b/dll/directx/wine/quartz/regsvr.c
@@ -18,9 +18,27 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "quartz_private.h"
-
-#include <uuids.h>
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#define COBJMACROS
+#include <stdarg.h>
+#include <string.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winerror.h"
+
+#include "ole2.h"
+#include "uuids.h"
+#include "strmif.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 /*
  * Near the bottom of this file are the exported DllRegisterServer and
diff --git a/dll/directx/wine/quartz/systemclock.c 
b/dll/directx/wine/quartz/systemclock.c
index 207bccb53a..1638e1117e 100644
--- a/dll/directx/wine/quartz/systemclock.c
+++ b/dll/directx/wine/quartz/systemclock.c
@@ -20,6 +20,12 @@
 
 #include "quartz_private.h"
 
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include <assert.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+
 typedef struct SystemClockAdviseEntry SystemClockAdviseEntry;
 struct SystemClockAdviseEntry {
   SystemClockAdviseEntry* next;
@@ -223,7 +229,7 @@ static ULONG WINAPI 
SystemClockImpl_Release(IReferenceClock* iface) {
   ULONG ref = InterlockedDecrement(&This->ref);
   TRACE("(%p): ReleaseRef to %d\n", This, ref);
   if (ref == 0) {
-    if (SystemClockPostMessageToAdviseThread(This, ADVISE_EXIT)) {
+    if (This->adviseThreadActive && SystemClockPostMessageToAdviseThread(This, 
ADVISE_EXIT)) {
       WaitForSingleObject(This->adviseThread, INFINITE);
       CloseHandle(This->adviseThread);
     }
diff --git a/dll/directx/wine/quartz/videorenderer.c 
b/dll/directx/wine/quartz/videorenderer.c
index 43448df50a..61f08f5156 100644
--- a/dll/directx/wine/quartz/videorenderer.c
+++ b/dll/directx/wine/quartz/videorenderer.c
@@ -18,7 +18,27 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include "amvideo.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "evcode.h"
+#include "strmif.h"
+#include "ddraw.h"
+#include "dvdmedia.h"
+
+#include <assert.h>
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 typedef struct VideoRendererImpl
 {
diff --git a/dll/directx/wine/quartz/vmr9.c b/dll/directx/wine/quartz/vmr9.c
index 6e06cf43b0..d9e4f46fe0 100644
--- a/dll/directx/wine/quartz/vmr9.c
+++ b/dll/directx/wine/quartz/vmr9.c
@@ -20,10 +20,28 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+
 #include "quartz_private.h"
 
-#include <d3d9.h>
-#include <vmr9.h>
+#include "uuids.h"
+#include "vfwmsgs.h"
+#include "amvideo.h"
+#include "windef.h"
+#include "winbase.h"
+#include "dshow.h"
+#include "evcode.h"
+#include "strmif.h"
+#include "ddraw.h"
+#include "dvdmedia.h"
+#include "d3d9.h"
+#include "vmr9.h"
+#include "pin.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 struct quartz_vmr
 {
diff --git a/dll/directx/wine/quartz/waveparser.c 
b/dll/directx/wine/quartz/waveparser.c
index 27006be568..f6bea2c704 100644
--- a/dll/directx/wine/quartz/waveparser.c
+++ b/dll/directx/wine/quartz/waveparser.c
@@ -19,6 +19,22 @@
  */
 
 #include "quartz_private.h"
+#include "pin.h"
+
+#include "uuids.h"
+#include "aviriff.h"
+#include "vfwmsgs.h"
+#include "mmsystem.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+#include <math.h>
+#include <assert.h>
+
+#include "parser.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' 
','p','i','n',0};
 
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index f702a41581..cd4452c42d 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -39,7 +39,7 @@ reactos/dll/directx/wine/dsound         # Synced to 
Wine-1.3.29
 reactos/dll/directx/wine/dxdiagn        # Synced to WineStaging-3.3
 reactos/dll/directx/wine/msdmo          # Synced to WineStaging-3.3
 reactos/dll/directx/wine/qedit          # Synced to WineStaging-3.3
-reactos/dll/directx/wine/quartz         # Synced to Wine-3.0
+reactos/dll/directx/wine/quartz         # Synced to WineStaging-3.3
 reactos/dll/directx/wine/wined3d        # Synced to WineStaging-3.3
 
 reactos/dll/win32/activeds            # Synced to WineStaging-2.9

Reply via email to