mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
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:
parent
3c2ca0cecc
commit
d44b4ccba1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user