From 2329e462291b9803450a67f7e3fac531823b95a6 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Sun, 8 Dec 2013 18:47:36 -0300 Subject: ao_wasapi: fix audio buffering delay calculation When get_space was converted to returning samples instead of bytes, a unit type mismatch in get_delay's calculation returned bogus values. Fix by converting get_space's value back to bytes. Fixes playback with ao_wasapi when reaching EOF, or seeking past it. --- audio/out/ao_wasapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index b43bf04753..4bdad1d242 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -1364,7 +1364,7 @@ static float get_delay(struct ao *ao) if (!ao || !ao->priv) return -1.0f; struct wasapi_state *state = (struct wasapi_state *)ao->priv; - return (float)(RING_BUFFER_COUNT * state->buffer_block_size - get_space(ao)) / + return (float)(RING_BUFFER_COUNT * state->buffer_block_size - get_space(ao) * ao->sstride) / (float)state->format.Format.nAvgBytesPerSec; } -- cgit v1.2.3