mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
audio/out: fail init on unknown audio buffer
A 0 audio buffer makes push.c go haywire. Shouldn't normally happen.
This commit is contained in:
parent
387d5f55e6
commit
4784ca32c9
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user