diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 17 | ||||
| -rw-r--r-- | src/lib/film.h | 8 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index d67182022..98b921029 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -72,6 +72,7 @@ using std::map; using std::vector; using std::setfill; using std::min; +using std::max; using std::make_pair; using std::endl; using std::cout; @@ -805,6 +806,7 @@ Film::set_audio_processor (AudioProcessor const * processor) { _audio_processor = processor; signal_changed (AUDIO_PROCESSOR); + signal_changed (AUDIO_CHANNELS); } void @@ -1230,3 +1232,18 @@ Film::audio_output_names () const return vector<string> (n.begin(), n.begin() + audio_channels ()); } + +int +Film::audio_channels () const +{ + int minimum = 0; + if (_audio_processor) { + minimum = _audio_processor->out_channels (); + } + + if (minimum % 2 == 1) { + ++minimum; + } + + return max (minimum, _audio_channels); +} diff --git a/src/lib/film.h b/src/lib/film.h index f9dc0ed9c..a1daebe78 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -223,9 +223,7 @@ public: return _video_frame_rate; } - int audio_channels () const { - return _audio_channels; - } + int audio_channels () const; bool three_d () const { return _three_d; @@ -326,7 +324,9 @@ private: int _video_frame_rate; /** The date that we should use in a ISDCF name */ boost::gregorian::date _isdcf_date; - /** Number of audio channels to put in the DCP */ + /** Number of audio channels requested for the DCP; this will be overridden + if we are using an audio processor which outputs more channels. + */ int _audio_channels; /** If true, the DCP will be written in 3D mode; otherwise in 2D. This will be regardless of what content is on the playlist. |
