X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Fdcpinfo.cc;h=aa1ce8c2425f8e1167991a83c4794f3f787ec5b4;hb=ad03415009155f8771ca48200f3c4a469c85277e;hp=38e43eb1425229b47e2fb0730b457b3e35deb7dd;hpb=dc9b744a5c7da5db0b77584f2d802347958790a0;p=libdcp.git diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc index 38e43eb1..aa1ce8c2 100644 --- a/tools/dcpinfo.cc +++ b/tools/dcpinfo.cc @@ -69,8 +69,8 @@ using std::max; using std::exception; using std::vector; using std::stringstream; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; +using std::shared_ptr; +using std::dynamic_pointer_cast; using boost::optional; using namespace dcp; @@ -162,10 +162,10 @@ main_picture (vector const& only, shared_ptr reel, bool analyse, b for (int64_t i = 0; i < ma->intrinsic_duration(); ++i) { shared_ptr frame = reader->get_frame (i); if (SHOULD_PICTURE) { - printf("Frame %" PRId64 " J2K size %7d", i, frame->j2k_size()); + printf("Frame %" PRId64 " J2K size %7d", i, frame->size()); } - j2k_size_range.first = min(j2k_size_range.first, frame->j2k_size()); - j2k_size_range.second = max(j2k_size_range.second, frame->j2k_size()); + j2k_size_range.first = min(j2k_size_range.first, frame->size()); + j2k_size_range.second = max(j2k_size_range.second, frame->size()); if (decompress) { try { @@ -248,7 +248,7 @@ main_subtitle (vector const& only, shared_ptr reel, bool list_subt OUTPUT_SUBTITLE(" Subtitle ID: %1", ms->id()); if (ms->asset_ref().resolved()) { - list > subs = ms->asset()->subtitles (); + auto subs = ms->asset()->subtitles (); OUTPUT_SUBTITLE("\n Subtitle: %1 subtitles", subs.size()); shared_ptr iop = dynamic_pointer_cast (ms->asset()); if (iop) { @@ -259,14 +259,14 @@ main_subtitle (vector const& only, shared_ptr reel, bool list_subt OUTPUT_SUBTITLE(" in %1\n", smpte->language().get()); } if (list_subtitles) { - BOOST_FOREACH (shared_ptr k, subs) { - shared_ptr ks = dynamic_pointer_cast (k); + for (auto k: subs) { + auto ks = dynamic_pointer_cast(k); if (ks) { stringstream s; s << *ks; OUTPUT_SUBTITLE("%1\n", s.str()); } - shared_ptr is = dynamic_pointer_cast (k); + auto is = dynamic_pointer_cast(k); if (is) { stringstream s; s << *is; @@ -283,6 +283,8 @@ main_subtitle (vector const& only, shared_ptr reel, bool list_subt int main (int argc, char* argv[]) { + dcp::init (); + bool subtitles = false; bool picture = false; bool decompress = false; @@ -358,10 +360,10 @@ main (int argc, char* argv[]) only = boost::split(only, *only_string, boost::is_any_of(",")); } - list > cpls; + vector > cpls; if (boost::filesystem::is_directory(argv[optind])) { DCP* dcp = 0; - list notes; + vector notes; try { dcp = new DCP (argv[optind]); dcp->read (¬es); @@ -395,7 +397,7 @@ main (int argc, char* argv[]) dcp::Time total_time; BOOST_FOREACH (shared_ptr i, cpls) { - OUTPUT_CPL_NAME_ID(" CPL: %1 %2\n", i->annotation_text(), i->id()); + OUTPUT_CPL_NAME_ID(" CPL: %1 %2\n", i->annotation_text().get_value_or(""), i->id()); int R = 1; BOOST_FOREACH (shared_ptr j, i->reels()) {