os: add invalidate_all packets to Audio_out

When a stream was stopped it may still contain valid packets that
will be played automatically when the stream is started again. The
invalidate_all() method may be called after stopping the stream to
prevent this.

Issue #1647.
This commit is contained in:
Josef Söntgen 2015-06-03 13:59:39 +02:00 committed by Christian Helmuth
parent e8c9125d9f
commit a6c5716796

View File

@ -244,6 +244,16 @@ class Audio_out::Stream
void reset() { _tail = _pos; }
/**
* Invalidate all packets in stream queue
*/
void invalidate_all()
{
for (int i = 0; i < QUEUE_SIZE; i++)
_buf[i]._valid = false;
}
/**********************************************
** Intended to be called by the server side **
***********************************************/