From: Carl Hetherington Date: Sun, 12 Apr 2015 16:20:10 +0000 (+0100) Subject: Hand-apply 97dde0e6d77b874742161703944d60524023664e from master. X-Git-Tag: v2.0.48~168 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=1f9c2f2699718da6f3f16ab7aa00b41789ec180a Hand-apply 97dde0e6d77b874742161703944d60524023664e from --- diff --git a/ChangeLog b/ChangeLog index 46ccc9122..a528dd827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-04-12 Carl Hetherington + + * Hand-apply 24ae3a8f0a68529b50c34079e643caf6b9327523 from master; + use the number of mapped audio channels for the DCP name, not the + number of DCP channels (#479). + 2015-03-25 Carl Hetherington * Remove scaler settings and just uses SWS_BICUBIC all round. diff --git a/TO_PORT b/TO_PORT index 479c0a059..e58362d86 100644 --- a/TO_PORT +++ b/TO_PORT @@ -1,4 +1,3 @@ -24ae3a8f0a68529b50c34079e643caf6b9327523 83f1ea8eacb4d56860ccdb9db5acdf12c6e71dfb c0e0b90d987af2586323d4a67bd67330256da51d 69866d9ba972d21375081c313ac245535ac55be9 diff --git a/src/lib/film.cc b/src/lib/film.cc index e5904ca1e..3aed4d965 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -581,11 +581,12 @@ Film::isdcf_name (bool if_created_now) const d << "_" << container()->isdcf_name(); } + ContentList cl = content (); + /* 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::iterator i = cl.begin(); i != cl.end(); ++i) { shared_ptr vc = dynamic_pointer_cast (*i); @@ -621,25 +622,34 @@ Film::isdcf_name (bool if_created_now) const } } - switch (audio_channels ()) { - case 1: - d << "_10"; - break; - case 2: - d << "_20"; - break; - case 3: - d << "_30"; - break; - case 4: - d << "_40"; - break; - case 5: - d << "_50"; - break; - case 6: - d << "_51"; - break; + /* Find all mapped channels */ + + list mapped; + for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) { + shared_ptr ac = dynamic_pointer_cast (*i); + if (ac) { + list c = ac->audio_mapping().mapped_dcp_channels (); + copy (c.begin(), c.end(), back_inserter (mapped)); + } + } + + mapped.sort (); + mapped.unique (); + + /* Count them */ + + int non_lfe = 0; + int lfe = 0; + for (list::const_iterator i = mapped.begin(); i != mapped.end(); ++i) { + if ((*i) == dcp::LFE) { + ++lfe; + } else { + ++non_lfe; + } + } + + if (non_lfe) { + d << "_" << non_lfe << lfe; } /* XXX: HI/VI */ @@ -1014,7 +1024,11 @@ Film::playlist_content_changed (boost::weak_ptr c, int p) { if (p == VideoContentProperty::VIDEO_FRAME_RATE) { set_video_frame_rate (_playlist->best_dcp_frame_rate ()); - } + } else if ( + p == AudioContentProperty::AUDIO_MAPPING || + p == AudioContentProperty::AUDIO_CHANNELS) { + signal_changed (NAME); + } if (ui_signaller) { ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p)); @@ -1025,6 +1039,7 @@ void Film::playlist_changed () { signal_changed (CONTENT); + signal_changed (NAME); } int