splitmuxsink: prevent deadlock when states change too fast
authorThiago Santos <thiagoss@osg.samsung.com>
Mon, 3 Aug 2015 16:42:20 +0000 (13:42 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Mon, 3 Aug 2015 16:46:16 +0000 (13:46 -0300)
commita930a1364a045a11802054c258c4ddddf5f562b1
tree363f8032ef7f20540145bf99f6403c8583dbbdfb
parentef7863355c7c7eca24fbd92d6457a91c02f042ac
splitmuxsink: prevent deadlock when states change too fast

If the GOP is completed, pads have to start gathering for the
next one but it is possible that the the state might go to
COLLECTING_GOP_START and back to WAITING_GOP_COMPLETE before the
thread has a chance to wake up and proceed, leaving it trapped in
the check_completed_gop loop and deadlocking the other threads
waiting for it to advance.

To solve it, this patch also checks that tha input running time
hasn't changed to prevent this scenario.
gst/multifile/gstsplitmuxsink.c