|author||wm4 <wm4@nowhere>||2016-09-16 20:24:52 +0200|
|committer||wm4 <wm4@nowhere>||2016-09-16 20:24:52 +0200|
player: don't enter playloop for client API requests
This _actually_ does what commit 8716c2e8 promised, and gives a slight performance improvement for client API users which make a lot of requests (like reading properties). The main issue was that mp_dispatch_lock() (which client.c uses to get exclusive access to the core) still called the wakeup callback, which made mp_dispatch_queue_process() exit. So the playloop got executed again, and since it does a lot of stuff, performance could be reduced.
Diffstat (limited to 'misc')
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/dispatch.c b/misc/dispatch.c
index 40729d9e8d..086896ba79 100644
@@ -122,6 +122,10 @@ static void mp_dispatch_append(struct mp_dispatch_queue *queue,
// Wake up the main thread; note that other threads might wait on this
// condition for reasons, so broadcast the condition.
+ // No wakeup callback -> assume mp_dispatch_queue_process() needs to be
+ // interrupted instead.
+ if (!queue->wakeup_fn)
+ queue->interrupted = true;