check: Avoid deadlock
authorEdward Hervey <edward.hervey@collabora.co.uk>
Tue, 17 Jul 2012 13:52:53 +0000 (15:52 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 18 Jul 2012 10:07:26 +0000 (12:07 +0200)
Queries will be sent when pipeline goes down to NULL, which would
result in the probe being called ... but can't take the lock.

tests/check/gst/gstghostpad.c

index 3212553b148897005c71a42cd2daa3ba2a66efeb..2a72ec545cac11fdddd250743648f1ba55c4ee58 100644 (file)
@@ -521,8 +521,8 @@ GST_START_TEST (test_ghost_pads_block)
   gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
   /* and wait now */
   g_cond_wait (block_data.cond, block_data.mutex);
-  gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
   g_mutex_unlock (block_data.mutex);
+  gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
 
   g_mutex_free (block_data.mutex);
   g_cond_free (block_data.cond);
@@ -563,8 +563,8 @@ GST_START_TEST (test_ghost_pads_probes)
   gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
   /* and wait now */
   g_cond_wait (block_data.cond, block_data.mutex);
-  gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
   g_mutex_unlock (block_data.mutex);
+  gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
 
   g_mutex_free (block_data.mutex);
   g_cond_free (block_data.cond);