From: Amine Khaldi Date: Fri, 26 Sep 2014 09:51:00 +0000 (+0000) Subject: [QUARTZ] X-Git-Tag: backups/0.3.17@66124~435 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=80675f700d32f7a3759533896b6bd07daa35dd2c [QUARTZ] * Sync with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=64305 --- diff --git a/reactos/dll/directx/wine/quartz/avisplit.c b/reactos/dll/directx/wine/quartz/avisplit.c index f651cf78167..a1b1c59a736 100644 --- a/reactos/dll/directx/wine/quartz/avisplit.c +++ b/reactos/dll/directx/wine/quartz/avisplit.c @@ -134,6 +134,7 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe PullPin *pin = This->Parser.pInputPin; IMediaSample *sample = NULL; HRESULT hr; + ULONG ref; TRACE("(%p, %u)->()\n", This, streamnumber); @@ -247,7 +248,10 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe hr = IAsyncReader_Request(pin->pReader, sample, streamnumber); if (FAILED(hr)) - assert(IMediaSample_Release(sample) == 0); + { + ref = IMediaSample_Release(sample); + assert(ref == 0); + } } else { @@ -261,7 +265,8 @@ static HRESULT AVISplitter_next_request(AVISplitterImpl *This, DWORD streamnumbe if (sample) { ERR("There should be no sample!\n"); - assert(IMediaSample_Release(sample) == 0); + ref = IMediaSample_Release(sample); + assert(ref == 0); } } TRACE("--> %08x\n", hr); @@ -493,8 +498,8 @@ static HRESULT AVISplitter_first_request(LPVOID iface) static HRESULT AVISplitter_done_process(LPVOID iface) { AVISplitterImpl *This = iface; - DWORD x; + ULONG ref; for (x = 0; x < This->Parser.cStreams; ++x) { @@ -508,7 +513,10 @@ static HRESULT AVISplitter_done_process(LPVOID iface) stream->thread = NULL; if (stream->sample) - assert(IMediaSample_Release(stream->sample) == 0); + { + ref = IMediaSample_Release(stream->sample); + assert(ref == 0); + } stream->sample = NULL; ResetEvent(stream->packet_queued); @@ -1202,6 +1210,7 @@ static HRESULT AVISplitter_Flush(LPVOID iface) { AVISplitterImpl *This = iface; DWORD x; + ULONG ref; TRACE("(%p)->()\n", This); @@ -1210,7 +1219,10 @@ static HRESULT AVISplitter_Flush(LPVOID iface) StreamData *stream = This->streams + x; if (stream->sample) - assert(IMediaSample_Release(stream->sample) == 0); + { + ref = IMediaSample_Release(stream->sample); + assert(ref == 0); + } stream->sample = NULL; ResetEvent(stream->packet_queued); diff --git a/reactos/dll/directx/wine/quartz/dsoundrender.c b/reactos/dll/directx/wine/quartz/dsoundrender.c index e5c345401b5..1169be89f41 100644 --- a/reactos/dll/directx/wine/quartz/dsoundrender.c +++ b/reactos/dll/directx/wine/quartz/dsoundrender.c @@ -225,7 +225,7 @@ end: static HRESULT DSoundRender_HandleEndOfStream(DSoundRenderImpl *This) { - while (1) + while (This->renderer.filter.state == State_Running) { DWORD pos1, pos2; DSoundRender_UpdatePositions(This, &pos1, &pos2); @@ -236,8 +236,8 @@ static HRESULT DSoundRender_HandleEndOfStream(DSoundRenderImpl *This) LeaveCriticalSection(&This->renderer.filter.csFilter); LeaveCriticalSection(&This->renderer.csRenderLock); WaitForSingleObject(This->blocked, 10); - EnterCriticalSection(&This->renderer.filter.csFilter); EnterCriticalSection(&This->renderer.csRenderLock); + EnterCriticalSection(&This->renderer.filter.csFilter); This->in_loop = 0; } diff --git a/reactos/dll/directx/wine/quartz/filesource.c b/reactos/dll/directx/wine/quartz/filesource.c index 46229cc6087..6644f64005b 100644 --- a/reactos/dll/directx/wine/quartz/filesource.c +++ b/reactos/dll/directx/wine/quartz/filesource.c @@ -834,7 +834,7 @@ static ULONG WINAPI FileAsyncReaderPin_Release(IPin * iface) CloseHandle(This->hFile); This->csList.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->csList); - CoTaskMemFree(This); + BaseOutputPin_Destroy(&This->pin); return 0; } return refCount; diff --git a/reactos/dll/directx/wine/quartz/filtergraph.c b/reactos/dll/directx/wine/quartz/filtergraph.c index 9aff4a2d610..b8c12040398 100644 --- a/reactos/dll/directx/wine/quartz/filtergraph.c +++ b/reactos/dll/directx/wine/quartz/filtergraph.c @@ -801,7 +801,7 @@ static HRESULT GetFilterInfo(IMoniker* pMoniker, VARIANT* pvar) hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL); if (SUCCEEDED(hr)) - TRACE("Moniker = %s\n", debugstr_w(V_UNION(pvar, bstrVal))); + TRACE("Moniker = %s\n", debugstr_w(V_BSTR(pvar))); if (pPropBagCat) IPropertyBag_Release(pPropBagCat); @@ -1050,7 +1050,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, } } - hr = IFilterGraph2_AddFilter(iface, pfilter, V_UNION(&var, bstrVal)); + hr = IFilterGraph2_AddFilter(iface, pfilter, V_BSTR(&var)); if (FAILED(hr)) { WARN("Unable to add filter (%x)\n", hr); IBaseFilter_Release(pfilter); @@ -1384,7 +1384,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) goto error; } - hr = IFilterGraph2_AddFilter(iface, pfilter, V_UNION(&var, bstrVal)); + hr = IFilterGraph2_AddFilter(iface, pfilter, V_BSTR(&var)); if (FAILED(hr)) { WARN("Unable to add filter (%x)\n", hr); IBaseFilter_Release(pfilter); @@ -1424,10 +1424,10 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) IPin_Release(ppinfilter); if (FAILED(hr)) { - WARN("Unable to connect %s to renderer (%x)\n", debugstr_w(V_UNION(&var, bstrVal)), hr); + WARN("Unable to connect %s to renderer (%x)\n", debugstr_w(V_BSTR(&var)), hr); goto error; } - TRACE("Connected, recursing %s\n", debugstr_w(V_UNION(&var, bstrVal))); + TRACE("Connected, recursing %s\n", debugstr_w(V_BSTR(&var))); VariantClear(&var); diff --git a/reactos/dll/directx/wine/quartz/filtermapper.c b/reactos/dll/directx/wine/quartz/filtermapper.c index 0d7e873b383..e13a9672eea 100644 --- a/reactos/dll/directx/wine/quartz/filtermapper.c +++ b/reactos/dll/directx/wine/quartz/filtermapper.c @@ -348,7 +348,7 @@ static HRESULT FM2_WriteFriendlyName(IPropertyBag * pPropBag, LPCWSTR szName) BSTR value; V_VT(&var) = VT_BSTR; - V_UNION(&var, bstrVal) = value = SysAllocString(szName); + V_BSTR(&var) = value = SysAllocString(szName); ret = IPropertyBag_Write(pPropBag, wszFriendlyName, &var); SysFreeString(value); @@ -367,7 +367,7 @@ static HRESULT FM2_WriteClsid(IPropertyBag * pPropBag, REFCLSID clsid) if (SUCCEEDED(hr)) { V_VT(&var) = VT_BSTR; - V_UNION(&var, bstrVal) = wszClsid; + V_BSTR(&var) = wszClsid; hr = IPropertyBag_Write(pPropBag, wszClsidName, &var); } CoTaskMemFree(wszClsid); @@ -779,7 +779,7 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter( } V_VT(&var) = VT_ARRAY | VT_UI1; - V_UNION(&var, parray) = psa; + V_ARRAY(&var) = psa; if (SUCCEEDED(hr)) hr = IPropertyBag_Write(pPropBag, wszFilterDataName, &var); @@ -928,7 +928,7 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( if (SUCCEEDED(hrSub)) hrSub = IPropertyBag_Read(pPropBagCat, wszMeritName, &var, NULL); - if (SUCCEEDED(hrSub) && (V_UNION(&var, ulVal) >= dwMerit)) + if (SUCCEEDED(hrSub) && (V_UI4(&var) >= dwMerit)) { CLSID clsidCat; IEnumMoniker * pEnum; @@ -941,14 +941,14 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( VARIANT temp; V_VT(&temp) = VT_EMPTY; IPropertyBag_Read(pPropBagCat, wszFriendlyName, &temp, NULL); - TRACE("Considering category %s\n", debugstr_w(V_UNION(&temp, bstrVal))); + TRACE("Considering category %s\n", debugstr_w(V_BSTR(&temp))); VariantClear(&temp); } hrSub = IPropertyBag_Read(pPropBagCat, wszClsidName, &var, NULL); if (SUCCEEDED(hrSub)) - hrSub = CLSIDFromString(V_UNION(&var, bstrVal), &clsidCat); + hrSub = CLSIDFromString(V_BSTR(&var), &clsidCat); if (SUCCEEDED(hrSub)) hrSub = ICreateDevEnum_CreateClassEnumerator(pCreateDevEnum, &clsidCat, &pEnum, 0); @@ -975,7 +975,7 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( VARIANT temp; V_VT(&temp) = VT_EMPTY; IPropertyBag_Read(pPropBag, wszFriendlyName, &temp, NULL); - TRACE("Considering filter %s\n", debugstr_w(V_UNION(&temp, bstrVal))); + TRACE("Considering filter %s\n", debugstr_w(V_BSTR(&temp))); VariantClear(&temp); } @@ -985,13 +985,13 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( } if (SUCCEEDED(hrSub)) - hrSub = SafeArrayAccessData(V_UNION(&var, parray), (LPVOID*)&pData); + hrSub = SafeArrayAccessData(V_ARRAY(&var), (LPVOID*)&pData); if (SUCCEEDED(hrSub)) hrSub = FM2_ReadFilterData(pData, &rf2); if (pData) - SafeArrayUnaccessData(V_UNION(&var, parray)); + SafeArrayUnaccessData(V_ARRAY(&var)); VariantClear(&var); @@ -1165,7 +1165,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( if (FAILED(hr)) return hr; - + while(IEnumMoniker_Next(ppEnumMoniker, 1, &IMon, &nb) == S_OK) { IMoniker_Release(IMon); @@ -1185,7 +1185,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( return E_OUTOFMEMORY; } ZeroMemory(regfilters, nb_mon * sizeof(REGFILTER)); /* will prevent bad free of Name in case of error. */ - + IEnumMoniker_Reset(ppEnumMoniker); while(IEnumMoniker_Next(ppEnumMoniker, 1, &IMon, &nb) == S_OK) { @@ -1203,7 +1203,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( hrSub = IPropertyBag_Read(pPropBagCat, wszClsidName, &var, NULL); if (SUCCEEDED(hrSub)) - hrSub = CLSIDFromString(V_UNION(&var, bstrVal), &clsid); + hrSub = CLSIDFromString(V_BSTR(&var), &clsid); VariantClear(&var); @@ -1212,14 +1212,14 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( if (SUCCEEDED(hrSub)) { - len = (strlenW(V_UNION(&var, bstrVal))+1) * sizeof(WCHAR); + len = (strlenW(V_BSTR(&var))+1) * sizeof(WCHAR); if (!(regfilters[idx].Name = CoTaskMemAlloc(len*2))) hr = E_OUTOFMEMORY; } if (SUCCEEDED(hrSub) && regfilters[idx].Name) { - memcpy(regfilters[idx].Name, V_UNION(&var, bstrVal), len); + memcpy(regfilters[idx].Name, V_BSTR(&var), len); regfilters[idx].Clsid = clsid; idx++; } @@ -1239,7 +1239,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( CoTaskMemFree(regfilters[idx].Name); CoTaskMemFree(regfilters); IEnumMoniker_Release(ppEnumMoniker); - + return hr; } @@ -1260,7 +1260,7 @@ static HRESULT WINAPI FilterMapper_RegisterFilter(IFilterMapper * iface, CLSID c { strcpyW(wszKeyName, wszFilterSlash); strcatW(wszKeyName, wszClsid); - + lRet = RegCreateKeyExW(HKEY_CLASSES_ROOT, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); hr = HRESULT_FROM_WIN32(lRet); } @@ -1276,7 +1276,7 @@ static HRESULT WINAPI FilterMapper_RegisterFilter(IFilterMapper * iface, CLSID c { strcpyW(wszKeyName, wszClsidSlash); strcatW(wszKeyName, wszClsid); - + lRet = RegCreateKeyExW(HKEY_CLASSES_ROOT, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); hr = HRESULT_FROM_WIN32(lRet); } @@ -1287,7 +1287,7 @@ static HRESULT WINAPI FilterMapper_RegisterFilter(IFilterMapper * iface, CLSID c hr = HRESULT_FROM_WIN32(lRet); RegCloseKey(hKey); } - + CoTaskMemFree(wszClsid); return hr; @@ -1347,7 +1347,7 @@ static HRESULT WINAPI FilterMapper_RegisterPin( strcpyW(wszPinsKeyName, wszPins); strcatW(wszPinsKeyName, wszSlash); strcatW(wszPinsKeyName, szName); - + lRet = RegCreateKeyExW(hKey, wszPinsKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hPinsKey, NULL); hr = HRESULT_FROM_WIN32(lRet); CoTaskMemFree(wszPinsKeyName); diff --git a/reactos/dll/directx/wine/quartz/parser.c b/reactos/dll/directx/wine/quartz/parser.c index 705c784577d..9b698dc8726 100644 --- a/reactos/dll/directx/wine/quartz/parser.c +++ b/reactos/dll/directx/wine/quartz/parser.c @@ -156,6 +156,7 @@ void Parser_Destroy(ParserImpl *This) { IPin *connected = NULL; ULONG pinref; + HRESULT hr; assert(!This->filter.refCount); PullPin_WaitForStateChange(This->pInputPin, INFINITE); @@ -164,9 +165,11 @@ void Parser_Destroy(ParserImpl *This) IPin_ConnectedTo(&This->pInputPin->pin.IPin_iface, &connected); if (connected) { - assert(IPin_Disconnect(connected) == S_OK); + hr = IPin_Disconnect(connected); + assert(hr == S_OK); IPin_Release(connected); - assert(IPin_Disconnect(&This->pInputPin->pin.IPin_iface) == S_OK); + hr = IPin_Disconnect(&This->pInputPin->pin.IPin_iface); + assert(hr == S_OK); } pinref = IPin_Release(&This->pInputPin->pin.IPin_iface); if (pinref) diff --git a/reactos/dll/directx/wine/quartz/regsvr.c b/reactos/dll/directx/wine/quartz/regsvr.c index 686257daa87..94f0bc72b7b 100644 --- a/reactos/dll/directx/wine/quartz/regsvr.c +++ b/reactos/dll/directx/wine/quartz/regsvr.c @@ -592,7 +592,7 @@ static HRESULT register_filters(struct regsvr_filter const *list) if (list->pins[i].mediatypes[j].subtype) memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].subtype, sizeof(CLSID)); else { - /* Subtype are often a combination of major type + fourcc/tag */ + /* Subtypes are often a combination of major type + fourcc/tag */ memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].majortype, sizeof(CLSID)); *(DWORD*)(lpClsid + j*2 + 1) = list->pins[i].mediatypes[j].fourcc; } diff --git a/reactos/dll/directx/wine/quartz/videorenderer.c b/reactos/dll/directx/wine/quartz/videorenderer.c index 42b29f1a447..0024befdf0d 100644 --- a/reactos/dll/directx/wine/quartz/videorenderer.c +++ b/reactos/dll/directx/wine/quartz/videorenderer.c @@ -352,11 +352,11 @@ static HRESULT WINAPI VideoRenderer_EndFlush(BaseRenderer* iface) if (This->renderer.pMediaSample) { ResetEvent(This->hEvent); LeaveCriticalSection(iface->pInputPin->pin.pCritSec); - LeaveCriticalSection(&iface->csRenderLock); LeaveCriticalSection(&iface->filter.csFilter); + LeaveCriticalSection(&iface->csRenderLock); WaitForSingleObject(This->hEvent, INFINITE); - EnterCriticalSection(&iface->filter.csFilter); EnterCriticalSection(&iface->csRenderLock); + EnterCriticalSection(&iface->filter.csFilter); EnterCriticalSection(iface->pInputPin->pin.pCritSec); } if (This->renderer.filter.state == State_Paused) { diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 01679f49f48..1de62438538 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -45,7 +45,7 @@ reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.17 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.27 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.17 reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27 -reactos/dll/directx/wine/quartz # Synced to Wine-1.7.17 +reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27 reactos/dll/directx/wine/wined3d # Synced to Wine-1.7.27 reactos/dll/win32/activeds # Synced to Wine-1.7.17