mirror of
https://github.com/mpv-player/mpv
synced 2024-09-09 01:16:56 +02:00
w32_common: avoid recursive dispatch queue calls
I suppose this doesn't matter in practice, i.e. even if calls relayed over the dispatch queue will cause WndProc to be invoked, WndProc will never run for a longer time. Preparation for removing recursion support from the dispatch queue code.
This commit is contained in:
parent
11c573fda0
commit
10584159df
@ -79,6 +79,7 @@ struct vo_w32_state {
|
|||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
bool terminate;
|
bool terminate;
|
||||||
struct mp_dispatch_queue *dispatch; // used to run stuff on the GUI thread
|
struct mp_dispatch_queue *dispatch; // used to run stuff on the GUI thread
|
||||||
|
bool in_dispatch;
|
||||||
|
|
||||||
struct w32_api api; // stores functions from dynamically loaded DLLs
|
struct w32_api api; // stores functions from dynamically loaded DLLs
|
||||||
|
|
||||||
@ -920,7 +921,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
|
|
||||||
// The dispatch queue should be processed as soon as possible to prevent
|
// The dispatch queue should be processed as soon as possible to prevent
|
||||||
// playback glitches, since it is likely blocking the VO thread
|
// playback glitches, since it is likely blocking the VO thread
|
||||||
mp_dispatch_queue_process(w32->dispatch, 0);
|
if (!w32->in_dispatch) {
|
||||||
|
w32->in_dispatch = true;
|
||||||
|
mp_dispatch_queue_process(w32->dispatch, 0);
|
||||||
|
w32->in_dispatch = false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_ERASEBKGND: // no need to erase background separately
|
case WM_ERASEBKGND: // no need to erase background separately
|
||||||
|
Loading…
Reference in New Issue
Block a user