[PATCH v3 0/2] MR7696: mf: Specify the timer queue for timer callbacks.
Calling MFScheduleWorkItemEx() schedules the operation in the timer queue, but unless GetParameters() returns the timer queue, callback invocation will occur in the standard queue. -- v3: mf: Specify the multithreaded queue for sample grabber timer callbacks. mf: Specify the multithreaded queue for presentation clock callbacks. https://gitlab.winehq.org/wine/wine/-/merge_requests/7696
From: Conor McCarthy <cmccarthy@codeweavers.com> Callback invocation for timed work occurs in the standard queue. For the session engine, this results in samples being delivered from the same thread which manages the session and executes transforms, which in some cases causes lag and dropped audio. In native Windows, samples may be delivered from at least two different threads. The multithreaded work queue responds to load, and new threads are created only when necessary. --- dlls/mf/clock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mf/clock.c b/dlls/mf/clock.c index 997994fc5f9..5fda57729a5 100644 --- a/dlls/mf/clock.c +++ b/dlls/mf/clock.c @@ -1048,7 +1048,9 @@ static ULONG WINAPI present_clock_sink_callback_Release(IMFAsyncCallback *iface) static HRESULT WINAPI present_clock_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) { - return E_NOTIMPL; + *flags = 0; + *queue = MFASYNC_CALLBACK_QUEUE_MULTITHREADED; + return S_OK; } static HRESULT WINAPI present_clock_sink_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7696
From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/mf/samplegrabber.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index a8c797f25ed..eaf1ce19e16 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -744,7 +744,9 @@ static ULONG WINAPI sample_grabber_stream_timer_callback_Release(IMFAsyncCallbac static HRESULT WINAPI sample_grabber_stream_timer_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) { - return E_NOTIMPL; + *flags = 0; + *queue = MFASYNC_CALLBACK_QUEUE_MULTITHREADED; + return S_OK; } static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7696
participants (2)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy)