diff options
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r-- | audio/out/ao.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c index a2a001c50c..b699b64c5a 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -194,6 +194,8 @@ static struct ao *ao_init(bool probing, struct mpv_global *global, ao->stream_silence = flags & AO_INIT_STREAM_SILENCE; + ao->period_size = 1; + int r = ao->driver->init(ao); if (r < 0) { // Silly exception for coreaudio spdif redirection @@ -209,6 +211,11 @@ static struct ao *ao_init(bool probing, struct mpv_global *global, goto fail; } + if (ao->period_size < 1) { + MP_ERR(ao, "Invalid period size set.\n"); + goto fail; + } + ao->sstride = af_fmt_to_bytes(ao->format); ao->num_planes = 1; if (af_fmt_is_planar(ao->format)) { |