From d44b4ccba1bfbcfb04316016b8f61441b3ef451e Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 Jan 2015 14:28:34 +0100 Subject: 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.) --- audio/out/ao.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3