summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-27 04:52:46 +0200
committerwm4 <wm4@nowhere>2014-09-27 04:52:46 +0200
commite79de41b97b497c355f113362da66988d6719260 (patch)
tree08795f782c71143095765334134544bf97ecc483
parentd778130dc483f4f70f385ce60b690781fe556d75 (diff)
downloadmpv-e79de41b97b497c355f113362da66988d6719260.tar.bz2
mpv-e79de41b97b497c355f113362da66988d6719260.tar.xz
audio/out: check device buffer size for push.c only
Should fix #1125.
-rw-r--r--audio/out/ao.c7
-rw-r--r--audio/out/push.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 8685260204..e87fc52d0e 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -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);
diff --git a/audio/out/push.c b/audio/out/push.c
index 3285543f24..2a84028e13 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -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);