}
check_for_switch:
- if (!dbin->upstream_handles_selection && collection == dbin->output_collection
- && collection->all_streams_present) {
+ if (!dbin->upstream_handles_selection
+ && collection == dbin->output_collection) {
handle_stream_switch (dbin);
}
*
* Figures out which slots to (de)activate for the given output_collection.
*
+ * Will only take place if all streams of the output collection are present.
+ *
* Must be called with SELECTION_LOCK taken.
*/
static void
g_return_if_fail (collection);
+ if (!collection->all_streams_present) {
+ GST_DEBUG_OBJECT (dbin,
+ "Not all streams are present yet. Delaying actual switch");
+ return;
+ }
+
/* COMPARE the requested streams to the active and requested streams
* on multiqueue. */
collection->seqnum = seqnum;
collection->posted_streams_selected_msg = FALSE;
- /* If the collection is the current output one, handle the switch */
+ /* If the collection is the current output one, handle the switch. */
if (collection == dbin->output_collection)
handle_stream_switch (dbin);