Blob Blame History Raw
From cb1b143b5b847e2320a58a6eb7af132eba685c9c Mon Sep 17 00:00:00 2001
From: Jun Xie <jun.xie@samsung.com>
Date: Tue, 27 Feb 2018 10:51:07 +0800
Subject: [PATCH] curlhttpsrc: deadlock in multi-instance scenario

Fixed queue iterator issue and set context state to
GSTCURL_MULTI_LOOP_STATE_RUNNING in case other
instance are in running state.

https://bugzilla.gnome.org/show_bug.cgi?id=793863
---
 ext/curl/gstcurlhttpsrc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ext/curl/gstcurlhttpsrc.c b/ext/curl/gstcurlhttpsrc.c
index a47508e62..e60ccf531 100644
--- a/ext/curl/gstcurlhttpsrc.c
+++ b/ext/curl/gstcurlhttpsrc.c
@@ -1668,8 +1668,10 @@ gst_curl_http_src_curl_multi_loop (gpointer thread_data)
         g_mutex_unlock (&qelement->p->buffer_mutex);
         gst_curl_http_src_remove_queue_item (&context->queue, qelement->p);
       }
+      qelement = qelement->next;
     }
     context->request_removal_element = NULL;
+    context->state = GSTCURL_MULTI_LOOP_STATE_RUNNING;
     g_mutex_unlock (&context->mutex);
   } else {
     GSTCURL_WARNING_PRINT ("Curl Loop State was invalid or unsupported");
-- 
2.17.1