summaryrefslogtreecommitdiffstats
path: root/audio/out/internal.h
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/internal.h
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/internal.h')
-rw-r--r--audio/out/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/out/internal.h b/audio/out/internal.h
index 4ee7f00f8a..e43b81a5ca 100644
--- a/audio/out/internal.h
+++ b/audio/out/internal.h
@@ -132,6 +132,8 @@ struct ao_driver {
float (*get_delay)(struct ao *ao);
// push based: block until all queued audio is played (optional)
void (*drain)(struct ao *ao);
+ // Optional. Return true if audio has stopped in any way.
+ bool (*get_eof)(struct ao *ao);
// Wait until the audio buffer needs to be refilled. The lock is the
// internal mutex usually protecting the internal AO state (and used to
// protect driver calls), and must be temporarily unlocked while waiting.