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.)
This commit is contained in:
wm4 2015-01-20 14:28:34 +01:00
parent 3c2ca0cecc
commit d44b4ccba1
1 changed files with 2 additions and 1 deletions

View File

@ -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)