Commit ee8e83bd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/sar: Handle shutdown state in rendering callback.

parent 02c859e4
...@@ -1750,9 +1750,8 @@ static HRESULT WINAPI audio_renderer_render_callback_GetParameters(IMFAsyncCallb ...@@ -1750,9 +1750,8 @@ static HRESULT WINAPI audio_renderer_render_callback_GetParameters(IMFAsyncCallb
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) static void audio_renderer_render(struct audio_renderer *renderer, IMFAsyncResult *result)
{ {
struct audio_renderer *renderer = impl_from_render_callback_IMFAsyncCallback(iface);
unsigned int src_frames, dst_frames, max_frames, src_len; unsigned int src_frames, dst_frames, max_frames, src_len;
struct queued_object *obj, *obj2; struct queued_object *obj, *obj2;
BOOL keep_sample = FALSE; BOOL keep_sample = FALSE;
...@@ -1760,8 +1759,6 @@ static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *if ...@@ -1760,8 +1759,6 @@ static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *if
BYTE *dst, *src; BYTE *dst, *src;
HRESULT hr; HRESULT hr;
EnterCriticalSection(&renderer->cs);
LIST_FOR_EACH_ENTRY_SAFE(obj, obj2, &renderer->queue, struct queued_object, entry) LIST_FOR_EACH_ENTRY_SAFE(obj, obj2, &renderer->queue, struct queued_object, entry)
{ {
if (obj->type == OBJECT_TYPE_MARKER) if (obj->type == OBJECT_TYPE_MARKER)
...@@ -1816,7 +1813,15 @@ static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *if ...@@ -1816,7 +1813,15 @@ static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *if
if (FAILED(hr = MFPutWaitingWorkItem(renderer->buffer_ready_event, 0, result, &renderer->buffer_ready_key))) if (FAILED(hr = MFPutWaitingWorkItem(renderer->buffer_ready_event, 0, result, &renderer->buffer_ready_key)))
WARN("Failed to submit wait item, hr %#x.\n", hr); WARN("Failed to submit wait item, hr %#x.\n", hr);
}
static HRESULT WINAPI audio_renderer_render_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
{
struct audio_renderer *renderer = impl_from_render_callback_IMFAsyncCallback(iface);
EnterCriticalSection(&renderer->cs);
if (!(renderer->flags & SAR_SHUT_DOWN))
audio_renderer_render(renderer, result);
LeaveCriticalSection(&renderer->cs); LeaveCriticalSection(&renderer->cs);
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment