X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_examiner.cc;h=89ddfd6eae907b49c3d1d46237275eea6a280ef6;hb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;hp=d0c3d1021eb1e5f4ee4f9ff95af596c4c32aa795;hpb=cb6729aa79b555b219974207fbe2ff0510f9d3ea;p=dcpomatic.git diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index d0c3d1021..89ddfd6ea 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -57,20 +57,10 @@ using std::dynamic_pointer_cast; DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) : DCP (content, tolerant) - , _video_length (0) - , _audio_length (0) - , _has_video (false) - , _has_audio (false) - , _encrypted (false) - , _needs_assets (false) - , _kdm_valid (false) - , _three_d (false) - , _has_atmos (false) - , _atmos_length (0) { shared_ptr cpl; - for (int i = 0; i < TEXT_COUNT; ++i) { + for (int i = 0; i < static_cast(TextType::COUNT); ++i) { _text_count[i] = 0; } @@ -127,7 +117,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) return; } - dcp::Fraction const frac = i->main_picture()->edit_rate (); + auto const frac = i->main_picture()->edit_rate (); float const fr = float(frac.numerator) / frac.denominator; if (!_video_frame_rate) { _video_frame_rate = fr; @@ -136,7 +126,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) } _has_video = true; - shared_ptr asset = i->main_picture()->asset (); + auto asset = i->main_picture()->asset(); if (!_video_size) { _video_size = asset->size (); } else if (_video_size.get() != asset->size ()) { @@ -154,7 +144,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) } _has_audio = true; - shared_ptr asset = i->main_sound()->asset (); + auto asset = i->main_sound()->asset(); if (!_audio_channels) { _audio_channels = asset->channels (); @@ -178,7 +168,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) return; } - _text_count[TEXT_OPEN_SUBTITLE] = 1; + _text_count[static_cast(TextType::OPEN_SUBTITLE)] = 1; } for (auto j: i->closed_captions()) { @@ -188,7 +178,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) return; } - _text_count[TEXT_CLOSED_CAPTION]++; + _text_count[static_cast(TextType::CLOSED_CAPTION)]++; _dcp_text_tracks.push_back (DCPTextTrack(j->annotation_text(), j->language().get_value_or(_("Unknown")))); } @@ -225,14 +215,14 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) /* Check that we can read the first picture, sound and subtitle frames of each reel */ try { for (auto i: cpl->reels()) { - shared_ptr pic = i->main_picture()->asset (); - shared_ptr mono = dynamic_pointer_cast (pic); - shared_ptr stereo = dynamic_pointer_cast (pic); + auto pic = i->main_picture()->asset (); + auto mono = dynamic_pointer_cast (pic); + auto stereo = dynamic_pointer_cast (pic); if (mono) { mono->start_read()->get_frame(0)->xyz_image (); } else { - stereo->start_read()->get_frame(0)->xyz_image (dcp::EYE_LEFT); + stereo->start_read()->get_frame(0)->xyz_image(dcp::Eye::LEFT); } if (i->main_sound()) {