mirror of https://github.com/mpv-player/mpv
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:
parent
62925a5c15
commit
2329e46229
|
@ -1364,7 +1364,7 @@ static float get_delay(struct ao *ao)
|
||||||
if (!ao || !ao->priv)
|
if (!ao || !ao->priv)
|
||||||
return -1.0f;
|
return -1.0f;
|
||||||
struct wasapi_state *state = (struct wasapi_state *)ao->priv;
|
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;
|
(float)state->format.Format.nAvgBytesPerSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue