bin: undo upward state changes on children when a child fails
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 15 Apr 2015 10:02:54 +0000 (11:02 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 15 Apr 2015 15:00:21 +0000 (16:00 +0100)
commita3b42ec42a085f4767930f55d5bb0b4f4fc8321a
tree77728c2116362a66a1c77e7a95364e13fc82c93a
parent5dea4b82dcb913d792c72be538e45eb333c0b58a
bin: undo upward state changes on children when a child fails

When a bin changes states upwards, and a child fails to change,
any child that was already switched will not be reset to its
original state, leaving its state inconsistent with the bin,
which does not change state due to the failure.

If the state change was from NULL to READY, it means that deleting
this bin will cause those children to be deleted while not in
NULL state, which is a Bad Thing. For other upward changes, it
is less of a problem, as a subsequent switch back to NULL will
cause an actual downwards change on those inconsistent elements,
albeit from the "wrong" state.

We now reset state to the original one when a child fails.

Includes unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=747610
gst/gstbin.c
tests/check/generic/states.c