X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Ffilm.cc;fp=src%2Flib%2Ffilm.cc;h=475dd68448628afba155ac59981b133f1b1e84f7;hb=cb1dfa9ec09af2abf6d10e4bf2764476db83841b;hp=577c29e3a55afeb8a7c85e29883c2bf7c30bcff6;hpb=dc120d521c740b7f1ec356538139c5769a5f54be;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index 577c29e3a..475dd6844 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -591,18 +591,22 @@ Film::isdcf_name (bool if_created_now) const d << "_" << container()->isdcf_name(); } - /* XXX: this only works for content which has been scaled to a given ratio, - and uses the first bit of content only. - */ + /* XXX: this uses the first bit of content only */ /* The standard says we don't do this for trailers, for some strange reason */ if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) { ContentList cl = content (); Ratio const * content_ratio = 0; - for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) { + for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) { shared_ptr vc = dynamic_pointer_cast (*i); - if (vc && (content_ratio == 0 || vc->scale().ratio() != content_ratio)) { - content_ratio = vc->scale().ratio(); + if (vc) { + /* Here's the first piece of video content */ + if (vc->scale().ratio ()) { + content_ratio = vc->scale().ratio (); + } else { + content_ratio = Ratio::from_ratio (vc->video_size().ratio ()); + } + break; } }