Skip to content

Commit c6fb743

Browse files
committed
Add dequeue prototype
1 parent d416c67 commit c6fb743

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

virtio-snd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,14 @@ static void __virtio_snd_frame_dequeue(short *out,
712712

713713
props->ring.cons.tail = cons_next;
714714

715+
if (list_empty(&props->buf_queue_head))
716+
goto finally;
717+
vsnd_buf_queue_node_t *node =
718+
list_first_entry(&props->buf_queue_head, vsnd_buf_queue_node_t, q);
719+
list_del(&node->q);
720+
// memcpy(out, node->addr, node->len);
721+
722+
finally:
715723
props->ring.buf_ev_notity--;
716724
pthread_cond_signal(&props->ring.writable);
717725
pthread_mutex_unlock(&props->ring.lock);

0 commit comments

Comments
 (0)