[PATCH 2/6] qcap: Return the connection type from IAMStreamConfig::GetFormat() if connected.

Zebediah Figura z.figura12 at gmail.com
Wed Nov 25 17:43:35 CST 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/qcap/vfwcapture.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c
index f0a985d5f4b..5c1ce9af980 100644
--- a/dlls/qcap/vfwcapture.c
+++ b/dlls/qcap/vfwcapture.c
@@ -344,8 +344,14 @@ static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_
     if (!(*mt = CoTaskMemAlloc(sizeof(**mt))))
         return E_OUTOFMEMORY;
 
-    if (SUCCEEDED(hr = capture_funcs->get_format(filter->device, *mt)))
+    EnterCriticalSection(&filter->filter.csFilter);
+
+    if (filter->source.pin.peer)
+        hr = CopyMediaType(*mt, &filter->source.pin.mt);
+    else if (SUCCEEDED(hr = capture_funcs->get_format(filter->device, *mt)))
         strmbase_dump_media_type(*mt);
+
+    LeaveCriticalSection(&filter->filter.csFilter);
     return hr;
 }
 
-- 
2.29.2




More information about the wine-devel mailing list