audio/out: check device buffer size for push.c only

Should fix #1125.
This commit is contained in:
wm4 2014-09-27 04:52:46 +02:00
parent d778130dc4
commit e79de41b97
2 changed files with 5 additions and 7 deletions

View File

@ -188,13 +188,6 @@ 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);

View File

@ -394,6 +394,11 @@ static int init(struct ao *ao)
pthread_cond_init(&p->wakeup_drain, NULL);
mp_make_wakeup_pipe(p->wakeup_pipe);
if (ao->device_buffer <= 0) {
MP_FATAL(ao, "Couldn't probe device buffer size.\n");
goto err;
}
p->buffer = mp_audio_buffer_create(ao);
mp_audio_buffer_reinit_fmt(p->buffer, ao->format,
&ao->channels, ao->samplerate);