timer_id is supposed to be protected by this mutex, make sure this
is true in spice_gst_decoder_reschedule.

Signed-off-by: Frediano Ziglio <fzig...@redhat.com>
---
 src/channel-display-gst.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 8b23036..201842e 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -438,9 +438,14 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
 static void spice_gst_decoder_reschedule(VideoDecoder *video_decoder)
 {
     SpiceGstDecoder *decoder = (SpiceGstDecoder*)video_decoder;
-    if (decoder->timer_id != 0) {
-        g_source_remove(decoder->timer_id);
-        decoder->timer_id = 0;
+
+    g_mutex_lock(&decoder->queues_mutex);
+    guint timer_id = decoder->timer_id;
+    decoder->timer_id = 0;
+    g_mutex_unlock(&decoder->queues_mutex);
+
+    if (timer_id != 0) {
+        g_source_remove(timer_id);
     }
     schedule_frame(decoder);
 }
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to