[QUARTZ] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 24 Nov 2015 12:33:33 +0000 (12:33 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 24 Nov 2015 12:33:33 +0000 (12:33 +0000)
svn path=/trunk/; revision=70092

14 files changed:
reactos/dll/directx/wine/quartz/CMakeLists.txt
reactos/dll/directx/wine/quartz/avisplit.c
reactos/dll/directx/wine/quartz/fil_data.idl
reactos/dll/directx/wine/quartz/filesource.c
reactos/dll/directx/wine/quartz/filtergraph.c
reactos/dll/directx/wine/quartz/filtermapper.c
reactos/dll/directx/wine/quartz/mpegsplit.c
reactos/dll/directx/wine/quartz/parser.c
reactos/dll/directx/wine/quartz/pin.c
reactos/dll/directx/wine/quartz/regsvr.c
reactos/dll/directx/wine/quartz/systemclock.c
reactos/dll/directx/wine/quartz/vmr9.c
reactos/dll/directx/wine/quartz/waveparser.c
reactos/media/doc/README.WINE

index 4bfc6e7..ce850ef 100644 (file)
@@ -1,4 +1,7 @@
 
+remove_definitions(-D_WIN32_WINNT=0x502)
+add_definitions(-D_WIN32_WINNT=0x600)
+
 add_definitions(
     -D__WINESRC__
     -DENTRY_PREFIX=QUARTZ_
@@ -52,7 +55,7 @@ list(APPEND quartz_rc_deps
 set_source_files_properties(version.rc PROPERTIES OBJECT_DEPENDS "${quartz_rc_deps}")
 set_module_type(quartz win32dll)
 target_link_libraries(quartz strmbase strmiids uuid dxguid wine ${PSEH_LIB})
-add_importlibs(quartz dsound msacm32 msvfw32 ole32 oleaut32 shlwapi rpcrt4 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
+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_cd_file(TARGET quartz DESTINATION reactos/system32 FOR all)
index 2696890..fec1174 100644 (file)
@@ -186,7 +186,7 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe
                 ++stream->index_next;
             }
 
-            rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(entry->dwSize & ~(1 << 31));
+            rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(entry->dwSize & ~(1u << 31));
 
             TRACE("offset(%u) size(%u)\n", (DWORD)BYTES_FROM_MEDIATIME(rtSampleStart), (DWORD)BYTES_FROM_MEDIATIME(rtSampleStop - rtSampleStart));
         }
@@ -579,7 +579,7 @@ static HRESULT AVISplitter_ProcessIndex(AVISplitterImpl *This, AVISTDINDEX **ind
         BOOL keyframe = !(pIndex->aIndex[x].dwSize >> 31);
         DWORDLONG offset = pIndex->qwBaseOffset + pIndex->aIndex[x].dwOffset;
         TRACE("dwOffset: %x%08x\n", (DWORD)(offset >> 32), (DWORD)offset);
-        TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1<<31)));
+        TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1u << 31)));
         TRACE("Frame is a keyframe: %s\n", keyframe ? "yes" : "no");
     }
 
@@ -977,7 +977,7 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This)
 
                     for (z = 0; z < stream->stdindex[y]->nEntriesInUse; ++z)
                     {
-                        UINT len = stream->stdindex[y]->aIndex[z].dwSize & ~(1 << 31);
+                        UINT len = stream->stdindex[y]->aIndex[z].dwSize & ~(1u << 31);
                         frames += len / stream->streamheader.dwSampleSize + !!(len % stream->streamheader.dwSampleSize);
                     }
                 }
@@ -1092,24 +1092,18 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
         return E_FAIL;
     }
 
-    pos += sizeof(RIFFCHUNK) + list.cb;
-    hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list);
-
-    while (list.fcc == ckidAVIPADDING || (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE))
+    /* Skip any chunks until we find the LIST chunk */
+    do
     {
         pos += sizeof(RIFFCHUNK) + list.cb;
-
         hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list);
     }
+    while (hr == S_OK && (list.fcc != FOURCC_LIST ||
+           (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE)));
 
-    if (list.fcc != FOURCC_LIST)
-    {
-        ERR("Expected LIST, but got %.04s\n", (LPSTR)&list.fcc);
-        return E_FAIL;
-    }
-    if (list.fccListType != listtypeAVIMOVIE)
+    if (hr != S_OK)
     {
-        ERR("Expected AVI movie list, but got %.04s\n", (LPSTR)&list.fccListType);
+        ERR("Failed to find LIST chunk from AVI file\n");
         return E_FAIL;
     }
 
@@ -1117,21 +1111,18 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
 
     /* FIXME: AVIX files are extended beyond the FOURCC chunk "AVI ", and thus won't be played here,
      * once I get one of the files I'll try to fix it */
-    if (hr == S_OK)
-    {
-        This->rtStart = pAviSplit->CurrentChunkOffset = MEDIATIME_FROM_BYTES(pos + sizeof(RIFFLIST));
-        pos += list.cb + sizeof(RIFFCHUNK);
-
-        pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos);
-        if (pos > total)
-        {
-            ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total >> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), (DWORD)pAviSplit->EndOfFile);
-            return E_FAIL;
-        }
+    This->rtStart = pAviSplit->CurrentChunkOffset = MEDIATIME_FROM_BYTES(pos + sizeof(RIFFLIST));
+    pos += list.cb + sizeof(RIFFCHUNK);
 
-        hr = IAsyncReader_SyncRead(This->pReader, BYTES_FROM_MEDIATIME(pAviSplit->CurrentChunkOffset), sizeof(pAviSplit->CurrentChunk), (BYTE *)&pAviSplit->CurrentChunk);
+    pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos);
+    if (pos > total)
+    {
+        ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total >> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), (DWORD)pAviSplit->EndOfFile);
+        return E_FAIL;
     }
 
+    hr = IAsyncReader_SyncRead(This->pReader, BYTES_FROM_MEDIATIME(pAviSplit->CurrentChunkOffset), sizeof(pAviSplit->CurrentChunk), (BYTE *)&pAviSplit->CurrentChunk);
+
     props->cbAlign = 1;
     props->cbPrefix = 0;
     /* Comrades, prevent shortage of buffers, or you will feel the consequences! DA! */
@@ -1325,7 +1316,7 @@ static HRESULT WINAPI AVISplitter_seek(IMediaSeeking *iface)
                 {
                     if (stream->streamheader.dwSampleSize)
                     {
-                        ULONG len = stream->stdindex[y]->aIndex[z].dwSize & ~(1 << 31);
+                        ULONG len = stream->stdindex[y]->aIndex[z].dwSize & ~(1u << 31);
                         ULONG size = stream->streamheader.dwSampleSize;
 
                         pin->dwSamplesProcessed += len / size;
@@ -1443,7 +1434,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
     if (FAILED(hr))
         return hr;
 
-    *ppv = This;
+    *ppv = &This->Parser.filter.IBaseFilter_iface;
 
     return hr;
 }
index 93cdf1e..ab93499 100644 (file)
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#pragma makedep header
+
 import "objidl.idl";
 import "strmif.idl";
 import "unknwn.idl";
index 909ff0e..3615555 100644 (file)
@@ -795,20 +795,18 @@ static HRESULT WINAPI FileAsyncReaderPin_QueryInterface(IPin * iface, REFIID rii
 
     *ppv = NULL;
 
-    if (IsEqualIID(riid, &IID_IUnknown))
-        *ppv = This;
-    else if (IsEqualIID(riid, &IID_IPin))
-        *ppv = This;
+    if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin))
+        *ppv = &This->pin.pin.IPin_iface;
     else if (IsEqualIID(riid, &IID_IAsyncReader))
         *ppv = &This->IAsyncReader_iface;
 
     if (*ppv)
     {
-        IUnknown_AddRef((IUnknown *)(*ppv));
+        IUnknown_AddRef((IUnknown *)*ppv);
         return S_OK;
     }
 
-    if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IMediaSeeking))
+    if (!IsEqualIID(riid, &IID_IMediaSeeking))
         FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
 
     return E_NOINTERFACE;
index 3caf8d7..9b1707d 100644 (file)
@@ -589,7 +589,7 @@ static HRESULT CheckCircularConnection(IFilterGraphImpl *This, IPin *out, IPin *
     if (info_out.dir != PINDIR_OUTPUT)
     {
         IBaseFilter_Release(info_out.pFilter);
-        return E_UNEXPECTED;
+        return VFW_E_CANNOT_CONNECT;
     }
 
     hr = IPin_QueryPinInfo(in, &info_in);
@@ -599,7 +599,7 @@ static HRESULT CheckCircularConnection(IFilterGraphImpl *This, IPin *out, IPin *
         goto out;
     if (info_in.dir != PINDIR_INPUT)
     {
-        hr = E_UNEXPECTED;
+        hr = VFW_E_CANNOT_CONNECT;
         goto out;
     }
 
@@ -891,6 +891,9 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut,
 
     TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
 
+    if(!ppinOut || !ppinIn)
+        return E_POINTER;
+
     if (TRACE_ON(quartz))
     {
         hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
index e13a967..2fd057e 100644 (file)
@@ -1514,7 +1514,7 @@ static HRESULT WINAPI FilterMapper_UnregisterFilter(IFilterMapper * iface, CLSID
         if (lRet != ERROR_SUCCESS)
             hr = HRESULT_FROM_WIN32(lRet);
 
-        lRet = SHDeleteKeyW(hKey, wszPins);
+        lRet = RegDeleteTreeW(hKey, wszPins);
         if (lRet != ERROR_SUCCESS)
             hr = HRESULT_FROM_WIN32(lRet);
 
@@ -1573,7 +1573,7 @@ static HRESULT WINAPI FilterMapper_UnregisterPin(IFilterMapper * iface, CLSID Fi
         strcatW(wszPinNameKey, wszSlash);
         strcatW(wszPinNameKey, Name);
 
-        lRet = SHDeleteKeyW(hKey, wszPinNameKey);
+        lRet = RegDeleteTreeW(hKey, wszPinNameKey);
         hr = HRESULT_FROM_WIN32(lRet);
         CoTaskMemFree(wszPinNameKey);
     }
index 1b1919f..a447cba 100644 (file)
@@ -23,6 +23,9 @@
 
 #include "quartz_private.h"
 
+#include <strmif.h>
+
+
 #define SEQUENCE_HEADER_CODE     0xB3
 #define PACK_START_CODE          0xBA
 
@@ -38,6 +41,7 @@
 typedef struct MPEGSplitterImpl
 {
     ParserImpl Parser;
+    IAMStreamSelect IAMStreamSelect_iface;
     LONGLONG EndOfFile;
     LONGLONG position;
     DWORD begin_offset;
@@ -47,11 +51,21 @@ typedef struct MPEGSplitterImpl
     BOOL seek;
 } MPEGSplitterImpl;
 
+static inline MPEGSplitterImpl *impl_from_IBaseFilter( IBaseFilter *iface )
+{
+    return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.filter.IBaseFilter_iface);
+}
+
 static inline MPEGSplitterImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
 {
     return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.sourceSeeking.IMediaSeeking_iface);
 }
 
+static inline MPEGSplitterImpl *impl_from_IAMStreamSelect( IAMStreamSelect *iface )
+{
+    return CONTAINING_RECORD(iface, MPEGSplitterImpl, IAMStreamSelect_iface);
+}
+
 static int MPEGSplitter_head_check(const BYTE *header)
 {
     /* If this is a possible start code, check for a system or video header */
@@ -97,9 +111,7 @@ static HRESULT parse_header(BYTE *header, LONGLONG *plen, LONGLONG *pduration)
     int bitrate_index, freq_index, lsf = 1, mpeg1, layer, padding, bitrate, length;
     LONGLONG duration;
 
-    if (!(header[0] == 0xff && ((header[1]>>5)&0x7) == 0x7 &&
-          ((header[1]>>1)&0x3) != 0 && ((header[2]>>4)&0xf) != 0xf &&
-          ((header[2]>>2)&0x3) != 0x3))
+    if (MPEGSplitter_head_check(header) != MPEG_AUDIO_HEADER)
     {
         FIXME("Not a valid header: %02x:%02x:%02x:%02x\n", header[0], header[1], header[2], header[3]);
         return E_INVALIDARG;
@@ -189,9 +201,9 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, IMediaSample *pCurrentSample)
             if (SUCCEEDED(hr))
             {
                 IMediaSample_SetTime(sample, &rtSampleStart, &rtSampleStop);
-                IMediaSample_SetPreroll(sample, 0);
-                IMediaSample_SetDiscontinuity(sample, 0);
-                IMediaSample_SetSyncPoint(sample, 1);
+                IMediaSample_SetPreroll(sample, FALSE);
+                IMediaSample_SetDiscontinuity(sample, FALSE);
+                IMediaSample_SetSyncPoint(sample, TRUE);
                 hr = IAsyncReader_Request(pin->pReader, sample, 0);
                 if (SUCCEEDED(hr))
                 {
@@ -461,7 +473,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO
     HRESULT hr;
     LONGLONG pos = 0; /* in bytes */
     BYTE header[10];
-    int streamtype = 0;
+    int streamtype;
     LONGLONG total, avail;
     AM_MEDIA_TYPE amt;
     PIN_INFO piOutput;
@@ -499,12 +511,37 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO
         hr = IAsyncReader_SyncRead(pPin->pReader, pos, 4, header);
         if (SUCCEEDED(hr))
             pos += 4;
-        TRACE("%x:%x:%x:%x\n", header[0], header[1], header[2], header[3]);
     } while (0);
 
-    while(SUCCEEDED(hr) && !(streamtype=MPEGSplitter_head_check(header)))
+    while(SUCCEEDED(hr))
     {
-        TRACE("%x:%x:%x:%x\n", header[0], header[1], header[2], header[3]);
+        TRACE("Testing header %x:%x:%x:%x\n", header[0], header[1], header[2], header[3]);
+
+        streamtype = MPEGSplitter_head_check(header);
+        if (streamtype == MPEG_AUDIO_HEADER)
+        {
+            LONGLONG length;
+            if (parse_header(header, &length, NULL) == S_OK)
+            {
+                BYTE next_header[4];
+                /* Ensure we have a valid header by seeking for the next frame, some bad
+                 * encoded ID3v2 may have an incorrect length and we end up finding bytes
+                 * like FF FE 00 28 which are nothing more than a Unicode BOM followed by
+                 * ')' character from inside a ID3v2 tag. Unfortunately that sequence
+                 * matches like a valid mpeg audio header.
+                 */
+                hr = IAsyncReader_SyncRead(pPin->pReader, pos + length - 4, 4, next_header);
+                if (FAILED(hr))
+                    break;
+                if (parse_header(next_header, &length, NULL) == S_OK)
+                    break;
+                TRACE("%x:%x:%x:%x is a fake audio header, looking for next...\n",
+                      header[0], header[1], header[2], header[3]);
+            }
+        }
+        else if (streamtype) /* Video or System stream */
+            break;
+
         /* No valid header yet; shift by a byte and check again */
         memmove(header, header+1, 3);
         hr = IAsyncReader_SyncRead(pPin->pReader, pos++, 1, header + 3);
@@ -695,7 +732,7 @@ static HRESULT MPEGSplitter_first_request(LPVOID iface)
         IMediaSample_SetPreroll(sample, FALSE);
         IMediaSample_SetDiscontinuity(sample, TRUE);
         IMediaSample_SetSyncPoint(sample, 1);
-        This->seek = 0;
+        This->seek = FALSE;
 
         hr = IAsyncReader_Request(pin->pReader, sample, 0);
         if (SUCCEEDED(hr))
@@ -712,9 +749,36 @@ static HRESULT MPEGSplitter_first_request(LPVOID iface)
     return hr;
 }
 
+static HRESULT WINAPI MPEGSplitter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
+{
+    MPEGSplitterImpl *This = impl_from_IBaseFilter(iface);
+    TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv);
+
+    *ppv = NULL;
+
+    if ( IsEqualIID(riid, &IID_IUnknown)
+      || IsEqualIID(riid, &IID_IPersist)
+      || IsEqualIID(riid, &IID_IMediaFilter)
+      || IsEqualIID(riid, &IID_IBaseFilter) )
+        *ppv = iface;
+    else if ( IsEqualIID(riid, &IID_IAMStreamSelect) )
+        *ppv = &This->IAMStreamSelect_iface;
+
+    if (*ppv)
+    {
+        IBaseFilter_AddRef(iface);
+        return S_OK;
+    }
+
+    if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
+        FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
+
+    return E_NOINTERFACE;
+}
+
 static const IBaseFilterVtbl MPEGSplitter_Vtbl =
 {
-    Parser_QueryInterface,
+    MPEGSplitter_QueryInterface,
     Parser_AddRef,
     Parser_Release,
     Parser_GetClassID,
@@ -731,6 +795,64 @@ static const IBaseFilterVtbl MPEGSplitter_Vtbl =
     Parser_QueryVendorInfo
 };
 
+static HRESULT WINAPI AMStreamSelect_QueryInterface(IAMStreamSelect *iface, REFIID riid, void **ppv)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    return IBaseFilter_QueryInterface(&This->Parser.filter.IBaseFilter_iface, riid, ppv);
+}
+
+static ULONG WINAPI AMStreamSelect_AddRef(IAMStreamSelect *iface)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    return IBaseFilter_AddRef(&This->Parser.filter.IBaseFilter_iface);
+}
+
+static ULONG WINAPI AMStreamSelect_Release(IAMStreamSelect *iface)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    return IBaseFilter_Release(&This->Parser.filter.IBaseFilter_iface);
+}
+
+static HRESULT WINAPI AMStreamSelect_Count(IAMStreamSelect *iface, DWORD *streams)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    FIXME("(%p/%p)->(%p) stub!\n", This, iface, streams);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AMStreamSelect_Info(IAMStreamSelect *iface, LONG index, AM_MEDIA_TYPE **media_type, DWORD *flags, LCID *lcid, DWORD *group, WCHAR **name, IUnknown **object, IUnknown **unknown)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    FIXME("(%p/%p)->(%d,%p,%p,%p,%p,%p,%p,%p) stub!\n", This, iface, index, media_type, flags, lcid, group, name, object, unknown);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI AMStreamSelect_Enable(IAMStreamSelect *iface, LONG index, DWORD flags)
+{
+    MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
+
+    FIXME("(%p/%p)->(%d,%x) stub!\n", This, iface, index, flags);
+
+    return E_NOTIMPL;
+}
+
+static const IAMStreamSelectVtbl AMStreamSelectVtbl =
+{
+    AMStreamSelect_QueryInterface,
+    AMStreamSelect_AddRef,
+    AMStreamSelect_Release,
+    AMStreamSelect_Count,
+    AMStreamSelect_Info,
+    AMStreamSelect_Enable
+};
+
 HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
 {
     MPEGSplitterImpl *This;
@@ -754,10 +876,11 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
         CoTaskMemFree(This);
         return hr;
     }
-    This->seek = 1;
+    This->IAMStreamSelect_iface.lpVtbl = &AMStreamSelectVtbl;
+    This->seek = TRUE;
 
     /* Note: This memory is managed by the parser filter once created */
-    *ppv = This;
+    *ppv = &This->Parser.filter.IBaseFilter_iface;
 
     return hr;
 }
index 9b698dc..ee048a9 100644 (file)
@@ -133,11 +133,11 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID *
       || IsEqualIID(riid, &IID_IPersist)
       || IsEqualIID(riid, &IID_IMediaFilter)
       || IsEqualIID(riid, &IID_IBaseFilter) )
-        *ppv = This;
+        *ppv = &This->filter.IBaseFilter_iface;
 
     if (*ppv)
     {
-        IUnknown_AddRef((IUnknown *)(*ppv));
+        IUnknown_AddRef((IUnknown *)*ppv);
         return S_OK;
     }
 
@@ -507,21 +507,21 @@ static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking * iface, REFII
 {
     ParserImpl *This = impl_from_IMediaSeeking(iface);
 
-    return IUnknown_QueryInterface((IUnknown *)This, riid, ppv);
+    return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv);
 }
 
 static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface)
 {
     ParserImpl *This = impl_from_IMediaSeeking(iface);
 
-    return IUnknown_AddRef((IUnknown *)This);
+    return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
 }
 
 static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface)
 {
     ParserImpl *This = impl_from_IMediaSeeking(iface);
 
-    return IUnknown_Release((IUnknown *)This);
+    return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
 }
 
 static const IMediaSeekingVtbl Parser_Seeking_Vtbl =
index e5db97a..9b703dc 100644 (file)
@@ -203,7 +203,7 @@ static HRESULT PullPin_Init(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinI
     pPinImpl->dRate = 1.0;
     pPinImpl->state = Req_Die;
     pPinImpl->fnCustomRequest = pCustomRequest;
-    pPinImpl->stop_playback = 1;
+    pPinImpl->stop_playback = TRUE;
 
     InitializeCriticalSection(&pPinImpl->thread_lock);
     pPinImpl->thread_lock.DebugInfo->Spare[0] = (DWORD_PTR)( __FILE__ ": PullPin.thread_lock");
@@ -406,6 +406,7 @@ static void PullPin_Flush(PullPin *This)
         {
             DWORD_PTR dwUser;
 
+            pSample = NULL;
             IAsyncReader_WaitForNext(This->pReader, 0, &pSample, &dwUser);
 
             if (!pSample)
@@ -628,7 +629,7 @@ HRESULT PullPin_StartProcessing(PullPin * This)
         /* Wake up! */
         assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT);
         This->state = Req_Run;
-        This->stop_playback = 0;
+        This->stop_playback = FALSE;
         ResetEvent(This->hEventStateChanged);
         SetEvent(This->thread_sleepy);
     }
@@ -654,7 +655,7 @@ HRESULT PullPin_PauseProcessing(PullPin * This)
         assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT);
 
         This->state = Req_Pause;
-        This->stop_playback = 1;
+        This->stop_playback = TRUE;
         ResetEvent(This->hEventStateChanged);
         SetEvent(This->thread_sleepy);
 
@@ -690,7 +691,7 @@ static HRESULT PullPin_StopProcessing(PullPin * This)
 
     assert(This->state == Req_Pause || This->state == Req_Sleepy);
 
-    This->stop_playback = 1;
+    This->stop_playback = TRUE;
     This->state = Req_Die;
     assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT);
     ResetEvent(This->hEventStateChanged);
index 94f0bc7..3da2c73 100644 (file)
@@ -240,7 +240,7 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list)
        WCHAR buf[39];
 
        StringFromGUID2(list->iid, buf, 39);
-       res = SHDeleteKeyW(interface_key, buf);
+       res = RegDeleteTreeW(interface_key, buf);
        if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
     }
 
@@ -346,18 +346,18 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
        WCHAR buf[39];
 
        StringFromGUID2(list->clsid, buf, 39);
-       res = SHDeleteKeyW(coclass_key, buf);
+       res = RegDeleteTreeW(coclass_key, buf);
        if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
        if (res != ERROR_SUCCESS) goto error_close_coclass_key;
 
        if (list->progid) {
-           res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->progid);
+           res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
            if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
            if (res != ERROR_SUCCESS) goto error_close_coclass_key;
        }
 
        if (list->viprogid) {
-           res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->viprogid);
+           res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
            if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
            if (res != ERROR_SUCCESS) goto error_close_coclass_key;
        }
@@ -500,7 +500,7 @@ static HRESULT unregister_mediatypes_parsing(struct regsvr_mediatype_parsing con
        if (res != ERROR_SUCCESS) break;
 
        StringFromGUID2(list->subtype, buf, 39);
-       res = SHDeleteKeyW(majortype_key, buf);
+       res = RegDeleteTreeW(majortype_key, buf);
        if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
 
        /* Removed majortype key if there is no more subtype key */
@@ -535,7 +535,7 @@ static HRESULT unregister_mediatypes_extension(struct regsvr_mediatype_extension
        res = ERROR_SUCCESS;
     else if (res == ERROR_SUCCESS)
        for (; res == ERROR_SUCCESS && list->majortype; ++list) {
-           res = SHDeleteKeyA(extensions_root_key, list->extension);
+           res = RegDeleteTreeA(extensions_root_key, list->extension);
            if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
        }
 
index bbc9179..207bccb 100644 (file)
@@ -209,7 +209,7 @@ static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REF
   if (IsEqualIID (riid, &IID_IUnknown) || 
       IsEqualIID (riid, &IID_IReferenceClock)) {
     SystemClockImpl_AddRef(iface);
-    *ppobj = This;
+    *ppobj = &This->IReferenceClock_iface;
     return S_OK;
   }
   
index 995dae9..68494f0 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <d3d9.h>
 #include <vmr9.h>
-#include <strmif.h>
 
 struct quartz_vmr
 {
@@ -3068,6 +3067,7 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren
         D3DDISPLAYMODE mode;
 
         hr = IDirect3D9_EnumAdapterModes(This->d3d9_ptr, i++, D3DFMT_X8R8G8B8, 0, &mode);
+       if (hr == D3DERR_INVALIDCALL) break; /* out of adapters */
     } while (FAILED(hr));
     if (FAILED(hr))
         ERR("HR: %08x\n", hr);
@@ -3094,6 +3094,6 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren
     This->SurfaceAllocatorNotify = NULL;
     This->reset = FALSE;
 
-    *ppv = This;
+    *ppv = &This->IVMRImagePresenter9_iface;
     return S_OK;
 }
index f133251..31ec627 100644 (file)
@@ -106,9 +106,9 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
         pin->rtCurrent = pin->rtNext;
         pin->rtNext = rtSampleStop;
 
-        IMediaSample_SetPreroll(newsample, 0);
-        IMediaSample_SetDiscontinuity(newsample, 0);
-        IMediaSample_SetSyncPoint(newsample, 1);
+        IMediaSample_SetPreroll(newsample, FALSE);
+        IMediaSample_SetDiscontinuity(newsample, FALSE);
+        IMediaSample_SetSyncPoint(newsample, TRUE);
 
         hr = IAsyncReader_Request(pin->pReader, newsample, 0);
     }
@@ -424,7 +424,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
     if (FAILED(hr))
         return hr;
 
-    *ppv = This;
+    *ppv = &This->Parser.filter.IBaseFilter_iface;
 
     return hr;
 }
index a85964d..272b27c 100644 (file)
@@ -39,7 +39,7 @@ reactos/dll/directx/wine/dsound         # Synced to Wine-1.3.29
 reactos/dll/directx/wine/dxdiagn        # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/msdmo          # Synced to WineStaging-1.7.47
 reactos/dll/directx/wine/qedit          # Synced to WineStaging-1.7.55
-reactos/dll/directx/wine/quartz         # Synced to WineStaging-1.7.47
+reactos/dll/directx/wine/quartz         # Synced to WineStaging-1.7.55
 reactos/dll/directx/wine/wined3d        # Synced to WineStaging-1.7.55
 
 reactos/dll/win32/activeds            # Synced to WineStaging-1.7.47