diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-07-03 13:09:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-07-03 13:09:48 +0100 |
| commit | 2d386f5010c5c70c53b306fa55a053268accac5d (patch) | |
| tree | d3f11dabb0d96f71b013f1c7afe8b6217c91de47 /src/lib/dcp_decoder.cc | |
| parent | ef3f29455d4628d7777843baab5ba0650c122b84 (diff) | |
Don't create decoders if they are not necessary.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 0b99e8dd0..c7294bda7 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -54,9 +54,12 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log) , _decode_referenced (false) { video.reset (new VideoDecoder (this, c, log)); - audio.reset (new AudioDecoder (this, c->audio, log)); - - subtitle.reset (new SubtitleDecoder (this, c->subtitle, log)); + if (c->audio) { + audio.reset (new AudioDecoder (this, c->audio, log)); + } + if (c->subtitle) { + subtitle.reset (new SubtitleDecoder (this, c->subtitle, log)); + } shared_ptr<dcp::CPL> cpl; BOOST_FOREACH (shared_ptr<dcp::CPL> i, cpls ()) { |
