From 6d1e417250fa4cbbc68983ead0e5c2516f9ba315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 26 Nov 2015 14:26:02 +0100 Subject: [PATCH] os: reset one packet further in Audio_out stream Since all Audio_out server components loop over the packet stream queue it is save to reset the tail position to one after the play position. We have to do this because we do not know exactly when the play position changes (i.e. the driver has processed the packet) and we might end up with a tail position before the current play position. Issue #1796. --- repos/os/include/audio_out_session/audio_out_session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/include/audio_out_session/audio_out_session.h b/repos/os/include/audio_out_session/audio_out_session.h index 144bcfc371..32d96bff1d 100644 --- a/repos/os/include/audio_out_session/audio_out_session.h +++ b/repos/os/include/audio_out_session/audio_out_session.h @@ -263,7 +263,7 @@ class Audio_out::Stream * * This means that allocation will start at current queue position. */ - void reset() { _tail = _pos; } + void reset() { _tail = (_pos + 1) % QUEUE_SIZE; } /**