summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-20 14:28:34 +0100
committerwm4 <wm4@nowhere>2015-01-20 14:28:34 +0100
commitd44b4ccba1bfbcfb04316016b8f61441b3ef451e (patch)
tree4b632ef2a40f9b02536e8e59aec616912a80827a
parent3c2ca0cecc7f88fb94449605b7b33fbdbb855ed0 (diff)
downloadmpv-d44b4ccba1bfbcfb04316016b8f61441b3ef451e.tar.bz2
mpv-d44b4ccba1bfbcfb04316016b8f61441b3ef451e.tar.xz
ao: never autoselect ao_null
Before this commit, ao_null was used as last fallback. This doesn't make too much sense. Why would you decode audio just to discard it? Let audio initialization fail instead. This also handles the weird but possible corner-case that ao_null might fail initializing, in which case e.g. ao_pcm could be autoselected. (This happened once, and had to be fixed manually.)
-rw-r--r--audio/out/ao.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index c749cd0701..f77ae4c24a 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -86,7 +86,6 @@ static const struct ao_driver * const audio_out_drivers[] = {
&audio_out_sndio,
#endif
&audio_out_null,
- // should not be auto-selected:
#if HAVE_COREAUDIO
&audio_out_coreaudio_exclusive,
#endif
@@ -291,6 +290,8 @@ autoprobe: ;
// now try the rest...
for (int i = 0; audio_out_drivers[i]; i++) {
const struct ao_driver *driver = audio_out_drivers[i];
+ if (driver == &audio_out_null)
+ break;
ao = ao_init(true, global, input_ctx, encode_lavc_ctx, samplerate,
format, channels, NULL, (char *)driver->name, NULL);
if (ao)