X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=f61d5106f14e42c5a60e71d015ed1221d015c152;hp=76cd8da9645f256708dfaee443c0053dde2d797c;hb=74873babf8ed3ffb3dd79858328d5b3f142479a3;hpb=25c15064f4c816d310c34e2e27092b3c2d02afb3 diff --git a/src/lib/film.cc b/src/lib/film.cc index 76cd8da96..f61d5106f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1038,7 +1038,16 @@ Film::j2c_path (int reel, Frame frame, Eyes eyes, bool tmp) const return file (p); } -/** Find all the DCPs in our directory that can be dcp::DCP::read() and return details of their CPLs */ +static +bool +cpl_summary_compare (CPLSummary const & a, CPLSummary const & b) +{ + return a.last_write_time > b.last_write_time; +} + +/** Find all the DCPs in our directory that can be dcp::DCP::read() and return details of their CPLs. + * The list will be returned in reverse order of timestamp (i.e. most recent first). + */ vector Film::cpls () const { @@ -1063,6 +1072,8 @@ Film::cpls () const } } + sort (out.begin(), out.end(), cpl_summary_compare); + return out; }