mpv/audio
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
..
decode ad_spdif: take care of deprecated libavcodec API usage 2016-04-20 19:37:45 +02:00
filter build: make libavfilter mandatory 2016-02-05 23:17:33 +01:00
out audio: apply an upper bound timeout when draining 2016-06-12 21:05:10 +02:00
audio.c audio: make mp_audio_skip_samples() adjust the PTS 2016-02-22 20:13:31 +01:00
audio.h audio: move frame clipping to a generic function 2016-02-21 18:16:41 +01:00
audio_buffer.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
audio_buffer.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap_sel.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
chmap_sel.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
fmt-conversion.c
fmt-conversion.h
format.c audio: add af_select_best_samplerate function 2016-03-17 02:31:05 -07:00
format.h audio: add af_select_best_samplerate function 2016-03-17 02:31:05 -07:00
mixer.c command: always allow setting volume/mute properties 2016-01-26 15:23:09 +01:00
mixer.h