Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfmediaengine/renderer.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/dlls/mfmediaengine/renderer.c b/dlls/mfmediaengine/renderer.c index d747f42774a..0d558e16963 100644 --- a/dlls/mfmediaengine/renderer.c +++ b/dlls/mfmediaengine/renderer.c @@ -513,6 +513,13 @@ static HRESULT WINAPI video_renderer_stream_ProcessSample(IMFStreamSink *iface,
/* FIXME: samples are dropped */
+ EnterCriticalSection(&renderer->cs); + + if (renderer->state == STREAM_STATE_RUNNING) + IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL); + + LeaveCriticalSection(&renderer->cs); + return S_OK; }
@@ -741,9 +748,12 @@ static HRESULT WINAPI video_renderer_clock_sink_OnClockStart(IMFClockStateSink * EnterCriticalSection(&renderer->cs);
if (renderer->state == STREAM_STATE_STOPPED) - renderer->state = STREAM_STATE_RUNNING; + { + IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkStarted, &GUID_NULL, S_OK, NULL); + IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL);
- IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkStarted, &GUID_NULL, S_OK, NULL); + renderer->state = STREAM_STATE_RUNNING; + }
LeaveCriticalSection(&renderer->cs);
@@ -796,7 +806,13 @@ static HRESULT WINAPI video_renderer_clock_sink_OnClockRestart(IMFClockStateSink
EnterCriticalSection(&renderer->cs);
- IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkStarted, &GUID_NULL, S_OK, NULL); + if (renderer->state != STREAM_STATE_RUNNING) + { + IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkStarted, &GUID_NULL, S_OK, NULL); + IMFMediaEventQueue_QueueEventParamVar(renderer->stream_event_queue, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL); + + renderer->state = STREAM_STATE_RUNNING; + }
LeaveCriticalSection(&renderer->cs);