[PATCH v3 6/6] winegstreamer: Use an atomic queue for wg_transform input buffers.

Zebediah Figura zfigura at codeweavers.com
Fri Jun 24 01:22:11 CDT 2022


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?



More information about the wine-devel mailing list