X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=30e3372522e50c4e73e417add515a143232396ff;hp=03ac66e944aeebfaac1522806d4187e9ceac3966;hb=ca981c8cfa23111e92be329f1c2dfbe3a07b4247;hpb=efc3486f2acf36bd0dc7b5528e7b3110ea8c4afe diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 03ac66e94..30e337252 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2019 Carl Hetherington + Copyright (C) 2014-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -18,6 +18,7 @@ */ +#include "atmos_decoder.h" #include "dcp_decoder.h" #include "dcp_content.h" #include "audio_content.h" @@ -29,6 +30,7 @@ #include "image.h" #include "config.h" #include "digester.h" +#include "frame_interval_checker.h" #include #include #include @@ -46,6 +48,7 @@ #include #include #include +#include #include #include @@ -75,6 +78,9 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptr (new TextDecoder (this, i, ContentTime()))); } + if (c->atmos) { + atmos.reset (new AtmosDecoder (this, c)); + } } /* We try to avoid re-scanning the DCP's files every time we make a new DCPDecoder; we do this @@ -214,6 +220,11 @@ DCPDecoder::pass () audio->emit (film(), _dcp_content->audio->stream(), data, ContentTime::from_frames (_offset, vfr) + _next); } + if (_atmos_reader) { + DCPOMATIC_ASSERT (_atmos_metadata); + atmos->emit (film(), _atmos_reader->get_frame(frame), frame, *_atmos_metadata); + } + _next += ContentTime::from_frames (1, vfr); if ((*_reel)->main_picture ()) { @@ -340,6 +351,7 @@ DCPDecoder::get_readers () _mono_reader.reset (); _stereo_reader.reset (); _sound_reader.reset (); + _atmos_reader.reset (); return; } @@ -365,6 +377,15 @@ DCPDecoder::get_readers () } else { _sound_reader.reset (); } + + if ((*_reel)->atmos()) { + shared_ptr asset = (*_reel)->atmos()->asset(); + _atmos_reader = asset->start_read(); + _atmos_metadata = AtmosMetadata (asset); + } else { + _atmos_reader.reset (); + _atmos_metadata = boost::none; + } } void @@ -450,7 +471,9 @@ DCPDecoder::calculate_lazy_digest (shared_ptr c) const BOOST_FOREACH (boost::filesystem::path i, c->paths()) { d.add (i.string()); } - d.add (static_cast(_dcp_content->kdm())); + if (_dcp_content->kdm()) { + d.add(_dcp_content->kdm()->id()); + } d.add (static_cast(c->cpl())); if (c->cpl()) { d.add (c->cpl().get());