diff options
author | wm4 <wm4@nowhere> | 2014-09-26 15:50:04 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-26 15:50:04 +0200 |
commit | 4784ca32c9d0fc79b08958c02dd3e826d5154d30 (patch) | |
tree | cba3e6e527f49c209065dae89e4bdb32aadd37ab /audio/out | |
parent | 387d5f55e639425bfb6ee1efec4e21202e5642ad (diff) | |
download | mpv-4784ca32c9d0fc79b08958c02dd3e826d5154d30.tar.bz2 mpv-4784ca32c9d0fc79b08958c02dd3e826d5154d30.tar.xz |
audio/out: fail init on unknown audio buffer
A 0 audio buffer makes push.c go haywire. Shouldn't normally happen.
Diffstat (limited to 'audio/out')
-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 00bda6d283..9e4dd88b5d 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -188,6 +188,13 @@ static struct ao *ao_create(bool probing, struct mpv_global *global, ao->device_buffer = ao->driver->get_space(ao); MP_VERBOSE(ao, "device buffer: %d samples.\n", ao->device_buffer); } + + if (ao->device_buffer <= 0) { + MP_FATAL(ao, "Couldn't probe device buffer size.\n"); + ao->driver->uninit(ao); + goto error; + } + ao->buffer = MPMAX(ao->device_buffer, ao->def_buffer * ao->samplerate); MP_VERBOSE(ao, "using soft-buffer of %d samples.\n", ao->buffer); |