GNOME Bugzilla – Bug 776303
vaapisink: race condition during caps negotiation with multiple src elements
Last modified: 2016-12-21 10:32:36 UTC
1. Reproduce step: # gst-validate-launcher -t validate.file.compositor.simple.seek_backward.bgra 2. Test pipeline gst-launch-1.0 compositor name=_mixer ! deinterlace ! videoconvert ! autovideosink videotestsrc ! video/x-raw, framerate=\(fraction\)10/1, width=100, height=100 ! _mixer. videotestsrc ! video/x-raw, framerate=\(fraction\)5/1, width=320, height=240 ! _mixer. 3. Result Sometimes negotiation fails, sometimes crash happens. 4. Cause During get_caps, vaapisink tries to make possible raw caps based on VAquery via gst_vaapi_plugin_base_get_allowed_raw_caps. At this moment, race condition causes crash or failure of negotiation.
Created attachment 342298 [details] [review] vaapisink: ensure raw_caps at start Calls gst_vaapi_plugin_base_get_allowed_raw_caps at start so that it avoid race condition at get_caps, especially with multiple src elements.
can you post the crash backtrace?
+ Trace 237006
Ok. Yes, the same race condition as in encoders.
Review of attachment 342298 [details] [review]: ::: gst/vaapi/gstvaapisink.c @@ +1221,1 @@ } I would change the code style to follow what is used in the project: if (!gst_vaapi_sink_ensure_display (sink)) return FALSE; /* explain here why we are doing this */ if (!gst_vaapi_plugin_base_allowed_raw_caps (GST...)) return FALSE; return TRUE;
Created attachment 342311 [details] [review] vaapisink: ensures raw_caps at start Calls gst_vaapi_plugin_base_get_allowed_raw_caps at start so that it avoid race condition at get_caps, especially with multiple src elements.
committed with minor modifications