From 6a16f8ef2efffea5e29f37c052633c13af9cb8f0 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sat, 26 Nov 2016 01:13:19 +1100 Subject: [PATCH] splitmux: Fix a small race in the splitmuxsrc Make sure the state of the parser is set to collecting streams before chaining up to the parent change_state() method, to close a small window that can cause playback to never commence. --- gst/multifile/gstsplitmuxpartreader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/multifile/gstsplitmuxpartreader.c b/gst/multifile/gstsplitmuxpartreader.c index 1753b37446..de814fb8a3 100644 --- a/gst/multifile/gstsplitmuxpartreader.c +++ b/gst/multifile/gstsplitmuxpartreader.c @@ -1042,6 +1042,9 @@ gst_splitmux_part_reader_change_state (GstElement * element, * changing the states of things, and type finding can continue */ SPLITMUX_PART_LOCK (reader); g_object_set (reader->src, "location", reader->path, NULL); + reader->prep_state = PART_STATE_PREPARING_COLLECT_STREAMS; + gst_splitmux_part_reader_set_flushing_locked (reader, FALSE); + reader->running = TRUE; SPLITMUX_PART_UNLOCK (reader); SPLITMUX_PART_TYPE_LOCK (reader); break; @@ -1082,9 +1085,6 @@ gst_splitmux_part_reader_change_state (GstElement * element, SPLITMUX_PART_TYPE_UNLOCK (reader); SPLITMUX_PART_LOCK (reader); - reader->prep_state = PART_STATE_PREPARING_COLLECT_STREAMS; - gst_splitmux_part_reader_set_flushing_locked (reader, FALSE); - reader->running = TRUE; while (reader->prep_state == PART_STATE_PREPARING_COLLECT_STREAMS) { GST_LOG_OBJECT (reader, "Waiting to collect all output streams");