u/sink: Tiny refactor for queue

This commit is contained in:
Moses Turner 2022-03-18 19:18:10 -05:00 committed by Mateo de Mayo
parent 703baa94fe
commit 662b72e2f6

View file

@ -98,20 +98,20 @@ queue_pop(struct u_sink_queue *q)
static bool
queue_try_refpush(struct u_sink_queue *q, struct xrt_frame *xf)
{
if (!queue_is_full(q)) {
struct u_sink_queue_elem *elem = U_TYPED_CALLOC(struct u_sink_queue_elem);
xrt_frame_reference(&elem->frame, xf);
elem->next = NULL;
if (q->back == NULL) { // First frame
q->front = elem;
} else { // Next frame
q->back->next = elem;
}
q->back = elem;
q->size++;
return true;
if (queue_is_full(q)) {
return false;
}
return false;
struct u_sink_queue_elem *elem = U_TYPED_CALLOC(struct u_sink_queue_elem);
xrt_frame_reference(&elem->frame, xf);
elem->next = NULL;
if (q->back == NULL) { // First frame
q->front = elem;
} else { // Next frame
q->back->next = elem;
}
q->back = elem;
q->size++;
return true;
}
//! Clears the queue and unreferences all of its frames.