From 48916ebd76811086c877e64820aaa7af4735272a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 31 Dec 2017 16:29:52 -0800 Subject: Clear the buffer queue when underrun --- examples/alffplay.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index 60b60a65..0f7eb769 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -746,9 +746,11 @@ int AudioState::handler() alGetSourcei(mSource, AL_SOURCE_STATE, &state); if(state == AL_STOPPED) { - /* AL_STOPPED means there was an underrun. Rewind the source to get + /* AL_STOPPED means there was an underrun. Clear the buffer queue + * since this likely means we're late, and rewind the source to get * it back into an AL_INITIAL state. */ + alSourcei(mSource, AL_BUFFER, 0); alSourceRewind(mSource); continue; } -- cgit v1.2.3