bin: removing child that failed state change does not restore clean state
Submitted by Aleksander Wabik
If one of the children of the bin fails state change, it is not sufficient to just remove it in order to restore clean state. From a quick glance at the gstbin.c, it looks like:
- when element's state change fails, all remaining children do not change state, so the bin may have some children in a changed state, and others in the old state,
- removing the child that failed statechange does not cause remaining children to transite to the previously requested state,
- removing the child that failed statechange does not restore bin's last state change return to a proper value - it's still an error,
- removing a child that posted async-start, if all other children have already posted async-done, will not cause the bin to post async-done if last state change return is error (even if the element that errored was already removed from the bin).
The simple workaround is to call again gst_element_set_state() on the bin after I remove the child that failed state change.