aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alffplay.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-12-31 16:29:52 -0800
committerChris Robinson <[email protected]>2017-12-31 16:29:52 -0800
commit48916ebd76811086c877e64820aaa7af4735272a (patch)
tree5b09d0b33bddd8ca00e17943d9c1e6ed40bc73a1 /examples/alffplay.cpp
parent506d316f5560803e4b24541b18d17ec39e59061b (diff)
Clear the buffer queue when underrun
Diffstat (limited to 'examples/alffplay.cpp')
-rw-r--r--examples/alffplay.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}