GNOME Bugzilla – Bug 684832
videodecoder: Takes stream lock in query function
Last modified: 2012-10-01 18:45:35 UTC
Created attachment 225183 [details] [review] videoencoder: clip input buffers to current input segment The video decoder takes the stream lock in the query function because that's what protects the output state, follows a patch to protect it with the object lock instead.
Review of attachment 225183 [details] [review]: Looks good in general, please push after addressing: ::: gst-libs/gst/video/gstvideodecoder.c @@ -2640,3 @@ state = _new_output_state (fmt, width, height, reference); - GST_VIDEO_DECODER_STREAM_LOCK (decoder); I'm pretty sure set_output_state() should also be protected by the stream lock. @@ +2842,3 @@ klass = GST_VIDEO_DECODER_GET_CLASS (decoder); + GST_OBJECT_LOCK (decoder); And the same for negotiate_default()
Created attachment 225366 [details] [review] videodecoder: Also use the object lock to protect the output_state This is a much less invasive patch. Also probably makes 62c111f1e obsolete Hold both the stream and the object lock to modify the output_state, this way it can be safely modified while hold either one or the other. Also, only hold the object lock in the query
Comment on attachment 225366 [details] [review] videodecoder: Also use the object lock to protect the output_state Yes, looks much simpler. Please push
Merged commit 531a5af30c17fe846076eefd6f51109df8ca00a9 Author: Olivier Crête <olivier.crete@collabora.com> Date: Fri Sep 28 20:07:43 2012 -0400 videodecoder: Also use the object lock to protect the output_state Hold both the stream and the object lock to modify the output_state, this way it can be safely modified while hold either one or the other. Also, only hold the object lock in the query https://bugzilla.gnome.org/show_bug.cgi?id=684832