GNOME Bugzilla – Bug 746011
gstpad : refactor gst_pad_link_prepare function
Last modified: 2015-06-02 15:42:37 UTC
Created attachment 299071 [details] [review] patch diff file In gst_pad_link_prepare function, GST_OBJECT_UNLOCK is not called about OK case. In other function that uses gst_pad_link_prepare(), should be called GST_OBJECT_UNLOCK about pad if gst_pad_link_prepare() will return OK. So I think other function's logic can become complex. (This patch is one of gstpad FIXME list.)
Please review this patch.
Created attachment 299082 [details] [review] gstpad: refactor gst_pad_link_prepare function I re-attach patch file
Add reviewer. Please review this patch
Review of attachment 299082 [details] [review]: Unlocking at the end of ::: gst/gstpad.c @@ +2350,3 @@ + GST_OBJECT_LOCK (srcpad); + GST_OBJECT_LOCK (sinkpad); You can't unlock in gst_pad_link_prepare() and re-lock here, stuff may have changed in between. How to make this more simple is not obvious to me, and I assume was not obvious to the person who wrote this.
Thank you for your opinion. gst_pad_link_prepare() return OK means we can use srcpad,sinkpad(to link them). So maybe GST_OBJECT_UNLOCK is not called at gst_pad_link_prepare() in OK case. But if we use gst_pad_link_prepare() just for checking(for example, gst_pad_can_link() API), we should unnecessarily add code to unlock pad for OK case. Also unnecessarily need comments for description.
What's up with this? Can it be closed?
@Olivier, @Tim-Philipp, I was brought the wrong problem from my wrong understanding about this function. Sorry for the confusion. So I will close this issue.