On 6/23/22 12:12, Rémi Bernon wrote:
@@ -802,17 +803,14 @@ NTSTATUS wg_transform_read_data(void *args) InterlockedIncrement(&sample->refcount); InterlockedExchangePointer((void **)&transform->output_wg_sample, sample);
- if (!gst_buffer_list_length(transform->input)) - GST_DEBUG("Not input buffer queued"); - else if ((input = gst_buffer_list_new())) + while (!transform->output_sample && ret == GST_FLOW_OK) { - ret = gst_pad_push_list(transform->my_src, transform->input); - transform->input = input; - } - else - { - GST_ERROR("Failed to allocate new input queue"); - ret = GST_FLOW_ERROR; + if ((input_buffer = gst_atomic_queue_pop(transform->input_queue))) + ret = gst_pad_push(transform->my_src, input_buffer); + transform->output_sample = gst_atomic_queue_pop(transform->output_queue); + + if (!input_buffer) + break; }
This is correct anyway, but the "ret == GST_FLOW_OK" feels wrong, as does continuing to process output samples even after we've hit an error condition. Would you mind moving the error check and break into the loop?