diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 66cb9b021a7..997c5054f12 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -1222,10 +1222,25 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt) IDirect3DSurface9_Release(surface); } +static HRESULT video_mixer_get_sample_desired_time(IMFSample *sample, LONGLONG *timestamp, LONGLONG *duration) +{ + IMFDesiredSample *desired; + HRESULT hr; + + if (SUCCEEDED(hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired))) + { + hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired, timestamp, duration); + IMFDesiredSample_Release(desired); + } + + return hr; +} + static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, MFT_OUTPUT_DATA_BUFFER *buffers, DWORD *status) { struct video_mixer *mixer = impl_from_IMFTransform(iface); + LONGLONG timestamp, duration; IDirect3DSurface9 *surface; IDirect3DDevice9 *device; unsigned int i; @@ -1272,12 +1287,17 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D } else { - if (SUCCEEDED(hr = video_mixer_get_d3d_device(mixer, &device))) + if (SUCCEEDED(video_mixer_get_sample_desired_time(buffers->pSample, ×tamp, &duration))) { - IDirect3DDevice9_ColorFill(device, surface, NULL, 0); - IDirect3DDeviceManager9_UnlockDevice(mixer->device_manager, mixer->device_handle, FALSE); - IDirect3DDevice9_Release(device); + if (SUCCEEDED(hr = video_mixer_get_d3d_device(mixer, &device))) + { + IDirect3DDevice9_ColorFill(device, surface, NULL, 0); + IDirect3DDeviceManager9_UnlockDevice(mixer->device_manager, mixer->device_handle, FALSE); + IDirect3DDevice9_Release(device); + } } + else + hr = MF_E_TRANSFORM_NEED_MORE_INPUT; } IDirect3DSurface9_Release(surface); } diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index f1831b58f89..dbc3bcbc582 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -2324,11 +2324,9 @@ static void test_mixer_samples(void) buffers[0].pSample = sample; hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status); -todo_wine ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr); color = get_surface_color(surface, 0, 0); -todo_wine ok(color == D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00), "Unexpected color %#x.\n", color); /* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */