[Spice-devel] [PATCH spice-gtk 2/3] channel-display-gst: Reduce contention on queues_mutex
Snir Sheriber
ssheribe at redhat.com
Mon Apr 16 11:41:40 UTC 2018
ack (Uri has the same patch :p)
On 04/16/2018 01:43 PM, Frediano Ziglio wrote:
> We don't need to lock the entire queues to create a frame.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> src/channel-display-gst.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 201842e..f5fa642 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -564,8 +564,9 @@ static gboolean spice_gst_decoder_queue_frame(VideoDecoder *video_decoder,
> GST_BUFFER_DTS(buffer) = GST_CLOCK_TIME_NONE;
> GST_BUFFER_PTS(buffer) = gst_clock_get_time(decoder->clock) - gst_element_get_base_time(decoder->pipeline) + ((uint64_t)MAX(0, latency)) * 1000 * 1000;
>
> + SpiceGstFrame *gst_frame = create_gst_frame(buffer, frame);
> g_mutex_lock(&decoder->queues_mutex);
> - g_queue_push_tail(decoder->decoding_queue, create_gst_frame(buffer, frame));
> + g_queue_push_tail(decoder->decoding_queue, gst_frame);
> g_mutex_unlock(&decoder->queues_mutex);
>
> if (gst_app_src_push_buffer(decoder->appsrc, buffer) != GST_FLOW_OK) {
More information about the Spice-devel
mailing list