Skip to content

Commit 85c06d7

Browse files
committed
Signal to consumer after buffer_bytes
1 parent 879fdd4 commit 85c06d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

virtio-snd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,9 @@ static void __virtio_snd_frame_enqueue(void *payload,
858858
props->ring.prod.tail = prod_next;
859859

860860
uint32_t buffer_bytes = props->pp.buffer_bytes;
861-
if (mask + cons_tail - prod_next >= buffer_bytes) {
861+
if (prod_next - cons_tail >= buffer_bytes) {
862862
fprintf(stderr, "buffer ready for %" PRIu32 " cons_tail %" PRIu32 " prod_next %" PRIu32 "\n",
863-
mask + cons_tail - prod_next, cons_tail, prod_next);
863+
prod_next - cons_tail, cons_tail, prod_next);
864864
props->ring.buf_ev_notity++;
865865
pthread_cond_signal(&props->ring.readable);
866866
}

0 commit comments

Comments
 (0)