Add --channel option to dcpomatic_create.
[dcpomatic.git] / src / tools / dcpomatic_create.cc
index 944ec32846e90637e41ca9935e2aa5ed253540c9..d78aef3df117ac346552c0e10386b92f314aac25 100644 (file)
@@ -137,6 +137,15 @@ main (int argc, char* argv[])
                                if (j->video) {
                                        j->video->set_frame_type (i.frame_type);
                                }
+                               if (j->audio && i.channel) {
+                                       for (auto stream: j->audio->streams()) {
+                                               AudioMapping mapping(stream->channels(), film->audio_channels());
+                                               for (int channel = 0; channel < stream->channels(); ++channel) {
+                                                       mapping.set(channel, *i.channel, 1.0f);
+                                               }
+                                               stream->set_mapping (mapping);
+                                       }
+                               }
                        }
                }