mirror of https://github.com/mpv-player/mpv
ao: remove trailing NULL element from driver array
This commit is contained in:
parent
50169e05d8
commit
98c2fa095d
|
@ -102,12 +102,11 @@ static const struct ao_driver * const audio_out_drivers[] = {
|
|||
#endif
|
||||
&audio_out_pcm,
|
||||
&audio_out_lavc,
|
||||
NULL
|
||||
};
|
||||
|
||||
static bool get_desc(struct m_obj_desc *dst, int index)
|
||||
{
|
||||
if (index >= MP_ARRAY_SIZE(audio_out_drivers) - 1)
|
||||
if (index >= MP_ARRAY_SIZE(audio_out_drivers))
|
||||
return false;
|
||||
const struct ao_driver *ao = audio_out_drivers[index];
|
||||
*dst = (struct m_obj_desc) {
|
||||
|
@ -313,7 +312,7 @@ struct ao *ao_init_best(struct mpv_global *global,
|
|||
}
|
||||
|
||||
if (autoprobe) {
|
||||
for (int n = 0; audio_out_drivers[n]; n++) {
|
||||
for (int n = 0; n < MP_ARRAY_SIZE(audio_out_drivers); n++) {
|
||||
const struct ao_driver *driver = audio_out_drivers[n];
|
||||
if (driver == &audio_out_null)
|
||||
break;
|
||||
|
@ -521,7 +520,7 @@ struct ao_device_list *ao_hotplug_get_device_list(struct ao_hotplug *hp,
|
|||
}
|
||||
}
|
||||
|
||||
for (int n = 0; audio_out_drivers[n]; n++) {
|
||||
for (int n = 0; n < MP_ARRAY_SIZE(audio_out_drivers); n++) {
|
||||
const struct ao_driver *d = audio_out_drivers[n];
|
||||
if (d == &audio_out_null)
|
||||
break; // don't add unsafe/special entries
|
||||
|
|
Loading…
Reference in New Issue