Module: wine Branch: master Commit: b9063c4b7e73d5fad19741c3ec0c485ca0e5b499 URL: https://source.winehq.org/git/wine.git/?a=commit;h=b9063c4b7e73d5fad19741c3e...
Author: Zebediah Figura z.figura12@gmail.com Date: Mon Jul 20 10:25:28 2020 -0500
quartz/vmr9: Render preroll samples.
The documentation specifies that preroll samples shouldn't be rendered, but the VMR9 renders them anyway.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/quartz/tests/vmr7.c | 3 +++ dlls/quartz/tests/vmr9.c | 3 +++ dlls/quartz/vmr9.c | 16 ---------------- 3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index cf4675ce06..f1b19aa663 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -983,6 +983,9 @@ static HANDLE send_frame(IMemInputPin *sink) hr = IMediaSample_SetTime(sample, &start_time, &end_time); ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaSample_SetPreroll(sample, TRUE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + params->sink = sink; params->sample = sample; thread = CreateThread(NULL, 0, frame_thread, params, 0, NULL); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index cd4df58f79..e630deb8d7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1011,6 +1011,9 @@ static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, DWO hr = IMediaSample_SetTime(sample, &start_time, &end_time); ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaSample_SetPreroll(sample, TRUE); + ok(hr == S_OK, "Got hr %#x.\n", hr); + params->sink = sink; params->sample = sample; thread = CreateThread(NULL, 0, frame_thread, params, 0, NULL); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index aeaefd52c6..a3f5501106 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -244,12 +244,6 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi if (IMediaSample_IsSyncPoint(sample) == S_OK) info.dwFlags |= VMR9Sample_SyncPoint;
- /* If we render ourselves, and this is a preroll sample, discard it */ - if (info.dwFlags & VMR9Sample_Preroll) - { - return S_OK; - } - if (FAILED(hr = IMediaSample_GetPointer(sample, &data))) { ERR("Failed to get pointer to sample data, hr %#x.\n", hr); @@ -504,15 +498,6 @@ static void vmr_stop_stream(struct strmbase_renderer *iface) ResetEvent(This->run_event); }
-static HRESULT WINAPI VMR9_ShouldDrawSampleNow(struct strmbase_renderer *iface, - IMediaSample *pSample, REFERENCE_TIME *start, REFERENCE_TIME *end) -{ - /* Preroll means the sample isn't shown, this is used for key frames and things like that */ - if (IMediaSample_IsPreroll(pSample) == S_OK) - return E_FAIL; - return S_FALSE; -} - static HRESULT vmr_connect(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface); @@ -668,7 +653,6 @@ static const struct strmbase_renderer_ops renderer_ops = .renderer_init_stream = vmr_init_stream, .renderer_start_stream = vmr_start_stream, .renderer_stop_stream = vmr_stop_stream, - .pfnShouldDrawSampleNow = VMR9_ShouldDrawSampleNow, .renderer_connect = vmr_connect, .pfnBreakConnect = VMR9_BreakConnect, .renderer_destroy = vmr_destroy,