GNOME Bugzilla – Bug 676048
fix deadlock in gst app src
Last modified: 2012-05-18 08:10:41 UTC
Created attachment 214033 [details] [review] fix deadlock in gst app src Perform seek start the loop which holds the live lock. This leads to deadlock half the time when the caller of perform seek, gst_base_src_start_complete, attempt to lock it too. Move the code protected by the live lock in gst_base_src_start_complete beofre the perform seek call.
The fix is not correct because it would set the result of the start operation before the last step of the operation is completed (doing the seek). Fortunately the solution is very easy: we use the stream lock to make the streaming thread wait as done in this patch: commit d6e909994c9316c69187a1e9729f45eeace62137 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed May 16 09:16:26 2012 +0200 basesrc: avoid potential deadlock In gst_base_src_start_complete() we do a perform_seek() that will eventually start the streaming thread which acquires the live lock and then goes to sleep in the case of appsrc. Right after we perform seek we also try to acquire the live lock which might then deadlock. fix this by taking the stream lock before performing the seek. This makes sure that the streaming thread cannot start and grab the live lock until we are done and release the stream lock again. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676048
*** Bug 673178 has been marked as a duplicate of this bug. ***