diff options
-rw-r--r-- | misc/dispatch.c | 4 | ||||
-rw-r--r-- | player/main.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/misc/dispatch.c b/misc/dispatch.c index 40729d9e8d..086896ba79 100644 --- a/misc/dispatch.c +++ b/misc/dispatch.c @@ -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. pthread_cond_broadcast(&queue->cond); + // No wakeup callback -> assume mp_dispatch_queue_process() needs to be + // interrupted instead. + if (!queue->wakeup_fn) + queue->interrupted = true; pthread_mutex_unlock(&queue->lock); if (queue->wakeup_fn) queue->wakeup_fn(queue->wakeup_ctx); diff --git a/player/main.c b/player/main.c index a6e82287d7..76300162f3 100644 --- a/player/main.c +++ b/player/main.c @@ -182,7 +182,6 @@ void mp_destroy(struct MPContext *mpctx) cas_terminal_owner(mpctx, NULL); } - mp_dispatch_set_wakeup_fn(mpctx->dispatch, NULL, NULL); mp_input_uninit(mpctx->input); uninit_libav(mpctx->global); @@ -356,7 +355,6 @@ struct MPContext *mp_create(void) #endif mp_input_set_cancel(mpctx->input, mpctx->playback_abort); - mp_dispatch_set_wakeup_fn(mpctx->dispatch, wakeup_playloop, mpctx); return mpctx; } |