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.
This commit is contained in:
Diogo Franco (Kovensky) 2013-12-08 18:47:36 -03:00
parent 62925a5c15
commit 2329e46229
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}