Un-map non-selected audio streams when loading old files.
authorCarl Hetherington <cth@carlh.net>
Fri, 12 Jun 2015 11:02:29 +0000 (12:02 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Jun 2015 11:02:29 +0000 (12:02 +0100)
ChangeLog
src/lib/ffmpeg_content.cc

index 11b48165d348851e3fcb27b3f2a58e9cf04c0d03..e750f82605f98e10c757b2f76f7fbc2216ffc771 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-12  c.hetherington  <cth@carlh.net>
+
+       * Fix for every audio stream being mapped to the DCP when loading
+       old films.
+
 2015-06-11  c.hetherington  <cth@carlh.net>
 
        * Fix massive slowdown of direct J2K->DCP encodes (#599).
index 9dc4afab9b3b1233d7f6d60301fccadef72475e9..608c8cdb7e31391f8f8fb1ddb0e33919387e6b68 100644 (file)
@@ -79,6 +79,10 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> f, cxml::ConstNodePtr node,
        c = node->node_children ("AudioStream");
        for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
                _audio_streams.push_back (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream (*i, version)));
+               if (version < 11 && !(*i)->optional_node_child ("Selected")) {
+                       /* This is an old file and this stream is not selected, so un-map it */
+                       _audio_streams.back()->set_mapping (AudioMapping (_audio_streams.back()->channels (), MAX_DCP_AUDIO_CHANNELS));
+               }
        }
 
        c = node->node_children ("Filter");