summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2023-01-14 18:19:40 +0000
committerDudemanguy <random342@airmail.cc>2023-01-16 19:25:54 +0000
commit98c2fa095d7fdf4ec8cc957466cadd04f0eacea4 (patch)
tree34468b76d9640798451a7f27de0535b246973429 /audio/out
parent50169e05d825280ece3fcc30f61f279b129babc7 (diff)
downloadmpv-98c2fa095d7fdf4ec8cc957466cadd04f0eacea4.tar.bz2
mpv-98c2fa095d7fdf4ec8cc957466cadd04f0eacea4.tar.xz
ao: remove trailing NULL element from driver array
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 768f98acb3..a5aa3a9402 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -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