From 732bf213974a7e433f97fac6aacf48e70c302452 Mon Sep 17 00:00:00 2001 From: Michal Trybus Date: Mon, 1 Jul 2019 15:55:10 +0200 Subject: [PATCH] Label-based order of outputs from multiple-output filters --- ffmpeg/_run.py | 2 +- ffmpeg/dag.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index 3167634..afc504d 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -84,7 +84,7 @@ def _allocate_filter_stream_names(filter_nodes, outgoing_edge_maps, stream_name_ stream_count = 0 for upstream_node in filter_nodes: outgoing_edge_map = outgoing_edge_maps[upstream_node] - for upstream_label, downstreams in list(outgoing_edge_map.items()): + for upstream_label, downstreams in sorted(outgoing_edge_map.items()): if len(downstreams) > 1: # TODO: automatically insert `splits` ahead of time via graph transformation. raise ValueError( diff --git a/ffmpeg/dag.py b/ffmpeg/dag.py index bb39823..9564d7f 100644 --- a/ffmpeg/dag.py +++ b/ffmpeg/dag.py @@ -100,7 +100,7 @@ def get_incoming_edges(downstream_node, incoming_edge_map): def get_outgoing_edges(upstream_node, outgoing_edge_map): edges = [] - for upstream_label, downstream_infos in list(outgoing_edge_map.items()): + for upstream_label, downstream_infos in sorted(outgoing_edge_map.items()): for downstream_info in downstream_infos: downstream_node, downstream_label, downstream_selector = downstream_info edges += [