audio_out_session: reset changes to 'pos = tail'

In case a driver is waiting for data, is should only investigate 'pos'.
It should not advance the ring in any way until there is data available.

issue #4609
This commit is contained in:
Sebastian Sumpf
2022-05-29 12:13:57 +02:00
committed by Norman Feske
parent 907641f6ea
commit e0c4d5068d

View File

@@ -252,8 +252,8 @@ class Audio_out::Stream
{ {
if (full()) if (full())
throw Alloc_failed(); throw Alloc_failed();
unsigned pos = _tail; unsigned pos = _tail;
_tail = (_tail + 1) % QUEUE_SIZE; _tail = (_tail + 1) % QUEUE_SIZE;
Packet *p = get(pos); Packet *p = get(pos);
@@ -267,7 +267,7 @@ class Audio_out::Stream
* *
* This means that allocation will start at current queue position. * This means that allocation will start at current queue position.
*/ */
void reset() { _tail = (_pos + 1) % QUEUE_SIZE; } void reset() { _tail = _pos; }
/** /**