diff options
author | wm4 <wm4@nowhere> | 2016-09-16 14:23:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-16 14:37:48 +0200 |
commit | b8ade7c99b830ee9870040bcfc1f2c3d3a64d172 (patch) | |
tree | 48df8031d90be4e6e1f9c9c4045a72e21c33862c /audio/out/push.c | |
parent | f845f64c2abe4361084b4bc07f5f1ea5dd43ec9f (diff) | |
download | mpv-b8ade7c99b830ee9870040bcfc1f2c3d3a64d172.tar.bz2 mpv-b8ade7c99b830ee9870040bcfc1f2c3d3a64d172.tar.xz |
player, ao, vo: don't call mp_input_wakeup() directly
Currently, calling mp_input_wakeup() will wake up the core thread (also
called the playloop). This seems odd, but currently the core indeed
calls mp_input_wait() when it has nothing more to do. It's done this way
because MPlayer used input_ctx as central "mainloop".
This is probably going to change. Remove direct calls to this function,
and replace it with mp_wakeup_core() calls. ao and vo are changed to use
opaque callbacks and not use input_ctx for this purpose. Other code
already uses opaque callbacks, or has legitimate reasons to use
input_ctx directly (such as sending actual user input).
Diffstat (limited to 'audio/out/push.c')
-rw-r--r-- | audio/out/push.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/out/push.c b/audio/out/push.c index 406b0da790..623ee6827a 100644 --- a/audio/out/push.c +++ b/audio/out/push.c @@ -305,7 +305,7 @@ static void ao_play_data(struct ao *ao) bool more = needed >= (r == space ? ao->device_buffer / 4 : 1) && !stuck && !(flags & AOPLAY_FINAL_CHUNK); if (more) - mp_input_wakeup(ao->input_ctx); // request more data + ao->wakeup_cb(ao->wakeup_ctx); // request more data MP_TRACE(ao, "in=%d flags=%d space=%d r=%d wa/pl=%d/%d needed=%d more=%d\n", max, flags, space, r, p->wait_on_ao, p->still_playing, needed, more); } @@ -347,7 +347,7 @@ static void *playthread(void *arg) } if (was_playing && !p->still_playing) - mp_input_wakeup(ao->input_ctx); + ao->wakeup_cb(ao->wakeup_ctx); pthread_cond_signal(&p->wakeup); // for draining if (p->still_playing && timeout > 0) { |