[PATCH 3/3] qcap/vfwcapture: Do not fail vfw_capture_init_stream() if IMemAllocator::SetProperties() fails.
Zebediah Figura
z.figura12 at gmail.com
Mon Jun 14 22:47:33 CDT 2021
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
Reported by a user in #winehq.
dlls/qcap/tests/videocapture.c | 2 +-
dlls/qcap/vfwcapture.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/qcap/tests/videocapture.c b/dlls/qcap/tests/videocapture.c
index 530b33a1e32..c44070b0bd5 100644
--- a/dlls/qcap/tests/videocapture.c
+++ b/dlls/qcap/tests/videocapture.c
@@ -435,7 +435,7 @@ static void test_filter_state(IMediaControl *control, IMemAllocator *allocator)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMediaControl_Pause(control);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMemAllocator_Decommit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c
index 48401344ac4..ae073b845e0 100644
--- a/dlls/qcap/vfwcapture.c
+++ b/dlls/qcap/vfwcapture.c
@@ -197,11 +197,9 @@ static HRESULT vfw_capture_init_stream(struct strmbase_filter *iface)
req_props.cbBuffer = get_image_size(filter);
req_props.cbAlign = 1;
req_props.cbPrefix = 0;
- if (FAILED(hr = IMemAllocator_SetProperties(filter->source.pAllocator, &req_props, &ret_props)))
- {
+ if (FAILED(hr = IMemAllocator_SetProperties(filter->source.pAllocator, &req_props, &ret_props))
+ && hr != VFW_E_ALREADY_COMMITTED)
ERR("Failed to set allocator properties (buffer size %u), hr %#x.\n", req_props.cbBuffer, hr);
- return hr;
- }
if (FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator)))
ERR("Failed to commit allocator, hr %#x.\n", hr);
--
2.30.2
More information about the wine-devel
mailing list