Skip to content

Commit

Permalink
os: reset one packet further in Audio_out stream
Browse files Browse the repository at this point in the history
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 genodelabs#1796.
  • Loading branch information
cnuke authored and chelmuth committed Nov 29, 2015
1 parent e3f301a commit 6d1e417
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repos/os/include/audio_out_session/audio_out_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }


/**
Expand Down

0 comments on commit 6d1e417

Please sign in to comment.