mpv/audio/out
wm4 b00eab525a audio: apply an upper bound timeout when draining
This helps with shitty APIs and even shittier drivers (I'm looking at
you, ALSA). Sometimes they won't send proper wakeups. This can be fine
during playback, when for example playing video, because mpv still will
wakeup the AO outside of its own wakeup mechanisms when sending new data
to it. But when draining, it entirely relies on the driver's wakeup
mechanism. So when the driver wakeup mechanism didn't work, it could
hard freeze while waiting for the audio thread to play the rest of the
data.

Avoid this by waiting for an upper bound. We set this upper bound at the
total mpv audio buffer size plus 1 second. We don't use the get_delay
value, because the audio API could return crap for it, and we're being
paranoid here. I couldn't confirm whether this works correctly, because
my driver issue fixed itself.

(In the case that happened to me, the driver somehow stopped getting
interrupts. aplay froze instead of playing audio, and playing audio-only
files resulted in a chop party. Video worked, for reasons mentioned
above, but drainign froze hard. The driver problem was solved when
closing all audio output streams in the system. Might have been a dmix
related problem too.)
2016-06-12 21:05:10 +02:00
..
ao.c ao: initial OpenSL ES support 2016-02-27 00:00:36 +01:00
ao.h audio: add option for falling back to ao_null 2015-10-05 19:12:23 +02:00
ao_alsa.c ao_alsa: add more shitty workarounds 2016-05-06 17:20:02 +02:00
ao_coreaudio.c ao_coreaudio: remove detected_device 2016-04-26 18:35:37 +02:00
ao_coreaudio_chmap.c ao_coreaudio: fix 7.1(rear) channel mapping 2016-02-04 12:29:32 +01:00
ao_coreaudio_chmap.h ao_coreaudio_chmap: change license to LGPL 2016-01-19 21:21:49 +01:00
ao_coreaudio_exclusive.c ao_coreaudio_exclusive: add missing newline to log message 2016-04-01 12:24:39 +02:00
ao_coreaudio_properties.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
ao_coreaudio_properties.h ao_coreaudio: report hardware latency to ao_read_data 2014-07-03 20:05:15 +02:00
ao_coreaudio_utils.c ao_coreaudio_exclusive: list formats when searching substream 2016-04-15 14:19:22 +02:00
ao_coreaudio_utils.h ao_coreaudio: remove unused function 2016-04-15 14:14:42 +02:00
ao_jack.c ao_jack: remove "alsa" std-channel-layout choice 2015-11-07 15:20:34 +01:00
ao_lavc.c encode_lavc: Migrate to codecpar API. 2016-04-11 14:57:20 -04:00
ao_null.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
ao_openal.c ao_openal: wipe out global context on init error 2016-01-18 20:46:22 -08:00
ao_opensles.c ao_opensles: remove 32bit audio 2016-05-22 14:31:37 +02:00
ao_oss.c build: silence -Wunused-result 2016-06-07 14:12:33 +02:00
ao_pcm.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
ao_pulse.c ao_pulse: attempt to fall back to an arbitrary sample format 2016-01-05 19:52:05 +01:00
ao_rsound.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
ao_sdl.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
ao_sndio.c ao_sndio: fix comment 2015-06-26 23:03:37 +02:00
ao_wasapi.c ao_wasapi: initialize COM in main thread with MTA 2016-06-05 16:31:03 -07:00
ao_wasapi.h ao_wasapi: replace laggy COM messaging with mp_dispatch_queue 2016-02-26 15:43:51 -08:00
ao_wasapi_changenotify.c win32: replace libuuid.a usage with initguid.h 2016-05-01 21:10:24 +10:00
ao_wasapi_utils.c ao_wasapi: use new af_select_best_samplerate function 2016-03-17 02:31:05 -07:00
internal.h ao: make better use of atomics 2015-05-11 23:27:41 +02:00
pull.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
push.c audio: apply an upper bound timeout when draining 2016-06-12 21:05:10 +02:00