summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-05 22:21:06 +0200
committerwm4 <wm4@nowhere>2014-09-05 23:45:54 +0200
commitbdf49d137e5fc63f22ddbb54f4d585719cdd2e5d (patch)
tree387f432aa04e14362f8f214a6919eeafe4ad99b7 /audio/out/ao.c
parent6b59d6a47b5c27179b60a3962f4680bbce6e89cd (diff)
downloadmpv-bdf49d137e5fc63f22ddbb54f4d585719cdd2e5d.tar.bz2
mpv-bdf49d137e5fc63f22ddbb54f4d585719cdd2e5d.tar.xz
audio/out: make EOF handling properly event-based
With --gapless-audio=no, changing from one file to the next apparently made it hang, until the player was woken up by unrelated events like input. The reason was that the AO doesn't notify the player of EOF properly. the played was querying ao_eof_reached(), and then just went to sleep, without anything waking it up. Make it event-based: the AO wakes up the playloop if the EOF state changes. We could have fixed this in a simpler way by synchronously draining the AO in these cases. But I think proper event handling is preferable. Fixes: #1069 CC: @mpv-player/stable (perhaps)
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r--audio/out/ao.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index f63f3fd09b..56d9232189 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -322,7 +322,7 @@ void ao_drain(struct ao *ao)
bool ao_eof_reached(struct ao *ao)
{
- return ao_get_delay(ao) < AO_EOF_DELAY;
+ return ao->api->get_eof ? ao->api->get_eof(ao) : true;
}
bool ao_chmap_sel_adjust(struct ao *ao, const struct mp_chmap_sel *s,