decodebin2: Avoid deactivation races
authorEdward Hervey <edward@centricular.com>
Thu, 16 Nov 2017 05:39:41 +0000 (06:39 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 16 Nov 2017 05:44:10 +0000 (06:44 +0100)
commite72aa501b02dbaa6271d002e6d6cd23301960bb5
tree95d01af5607af0c680766ca59643775bf5bda609
parent4c2f91d69e82917b3c1744bac87b8f120ec3f97f
decodebin2: Avoid deactivation races

Deactivating pads from two threads isn't 100% MT-safe. There is a
slim chance that the GstPadActivateFunc might be called twice with
the same values (in this case from the cleanup thread *and* from
the GstElement change_state function when going from PAUSED to READY).

In order to avoid that, call any existing cleanup function *before*
calling the parent change_state implementation on downwards state
changes.
gst/playback/gstdecodebin2.c