This fixes a test failure/crash on Windows 8.1 introduced by dd1d82728811c15716eefa0917eb3ecac4b9a85a.
From: Charlotte Pabst cpabst@codeweavers.com
This fixes a test failure/crash on Windows 8.1 introduced by dd1d82728811c15716eefa0917eb3ecac4b9a85a. --- dlls/mfplat/tests/mfplat.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 8c0b50a85cf..f77ab685bc0 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6836,10 +6836,14 @@ static IMFSample *test_xvp_process_sample(IMFTransform *xvp, IMFSample *in_sampl hr = IMFTransform_GetOutputStreamInfo(xvp, 0, &info); ok(hr == S_OK, "Failed to get output stream info, hr %#lx.\n", hr);
- ok(!!(info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES), "MFT_OUTPUT_STREAM_PROVIDES_SAMPLES expected\n"); - ok(!(info.dwFlags & MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES), "MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES unexpected\n"); ok(info.cbSize == 4, "Output size should be 4.\n");
+ if (!out_sample && !(info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) && !(info.dwFlags & MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES)) + { + win_skip("Output stream can't provide samples\n"); + return NULL; + } + hr = IMFTransform_ProcessInput(xvp, 0, in_sample, 0); ok(hr == S_OK, "Failed to process input, hr %#lx.\n", hr);
@@ -6936,7 +6940,8 @@ static void test_xvp_playback_mode(void)
in_sample = create_dxgi_sample(device, 0xdeadbeef, 0);
- IMFSample_Release(test_xvp_process_sample(xvp, in_sample, NULL)); + got_out_sample = test_xvp_process_sample(xvp, in_sample, NULL); + if (got_out_sample != NULL) IMFSample_Release(got_out_sample);
hr = IMFTransform_ProcessMessage(xvp, MFT_MESSAGE_NOTIFY_END_STREAMING, 0); ok(hr == S_OK, "Failed to end streaming, hr %#lx.\n", hr); @@ -6949,7 +6954,7 @@ static void test_xvp_playback_mode(void)
ok(got_out_sample == out_sample, "Video processor should use caller-provided sample.\n");
- if (got_out_sample != out_sample) IMFSample_Release(got_out_sample); + if (got_out_sample != out_sample && got_out_sample != NULL) IMFSample_Release(got_out_sample); IMFSample_Release(in_sample); IMFSample_Release(out_sample); IMFMediaType_Release(type);