splitmuxsrc: Fix some deadlock conditions and a crash
authorJan Schmidt <jan@centricular.com>
Mon, 23 Mar 2020 13:23:24 +0000 (00:23 +1100)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 26 Mar 2020 18:44:54 +0000 (14:44 -0400)
commit00a08c69acc99566d6ceac0b5a8cc5b532a62dfa
treedb2180afe742154a24afff927ab73899897ea3c7
parent8ef172d8b4466a4bf1b8040cd184dc52b42565b4
splitmuxsrc: Fix some deadlock conditions and a crash

When switching the splitmuxsrc state back to NULL quickly, it
can encounter deadlocks shutting down the part readers that
are still starting up, or encounter a crash if the splitmuxsrc
cleaned up the parts before the async callback could run.

Taking the state lock to post async-start / async-done messages can
deadlock if the state change function is trying to shut down the
element, so use some finer grained locks for that.
gst/multifile/gstsplitmuxpartreader.c
gst/multifile/gstsplitmuxpartreader.h
gst/multifile/gstsplitmuxsrc.c
gst/multifile/gstsplitmuxsrc.h