GNOME Bugzilla – Bug 752800
basetransform: may return not-negotiation on shutdown
Last modified: 2015-08-16 13:39:59 UTC
Created attachment 308039 [details] [review] basetransform: Return FLOW_FLUSHING if negotiation fails during shutdown There is a race in basetransform, where, if setcaps is called from default_submit_input_buffer() while it is shutting down, the setcaps may fail because the srcpad has already been set to flushing, this will then "goto not_negotiated" and return flow-not-negotiated , instead of flow-flushing. Possible (not so nice) patch is attached. I can reproduce it quite reliably with validate.file.playback.change_state_intensive.raw_video_mkv: GST_GL_XINITTHREADS=1 DISPLAY=:1 GST_VALIDATE_SCENARIO=change_state_intensive gst-validate-1.0 playbin uri=file:///home/ocrete/gst-validate/gst-integration-testsuites/medias/defaults/matroska/raw_video.mkv audio-sink='fakesink sync=true' video-sink='fakesink sync=true' --set-media-info "/home/ocrete/gst-validate/gst-integration-testsuites/medias/defaults/matroska/raw_video.mkv.media_info"
Could swear the exact same thing was fixed some time ago already, maybe it was elsewhere.
And I'm seeing the same thing in gst_ffmpegviddec_video_frame()
Created attachment 308043 [details] [review] avviddec: Ignore negotiation error on shutdown
Review of attachment 308039 [details] [review]: Yes, I think we fixed similar issues in many many places already, so I'd say make sense.
Indeed we did the exact same thing in many places already... and yes it is not so nice... Can't we think of a way of doing that in the pad generically? (just wondering here)
I think the problem is that we have function returning gboolean, but running function that return FLOW_RETURN internally, and we loose the notion of FLUSHING. Fortunatly, all thread stops when that happen, and the pad is left with the flushing flag, that we check. We could duplicate the API function that are affected and start using it ?
Merged: commit 5e5a14028a8605f957b5acf2c2170850d02a7b51 Author: Olivier Crête <olivier.crete@collabora.com> Date: Thu Jul 23 18:15:05 2015 -0400 basetransform: Return FLOW_FLUSHING if negotiation fails during shutdown https://bugzilla.gnome.org/show_bug.cgi?id=752800 commit 6bfe79d903d8d855b16a8136d15b631aaf01de5b Author: Olivier Crête <olivier.crete@collabora.com> Date: Thu Jul 23 19:15:43 2015 -0400 avviddec: Ignore negotiation error on shutdown https://bugzilla.gnome.org/show_bug.cgi?id=752800