X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=f9877523a0d3b4ef4b0ef56fc1163e866fb5f6fc;hb=7904ba56bba3a107087546b09139b60544f5c272;hp=bff205cfb3496dcef7bd58575cb36a9b4f8d9293;hpb=83416808c0b1ca732e7a186d3811f1ec796fea08;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index bff205cfb..f9877523a 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -362,7 +362,7 @@ dcpomatic_setup () /* Add our library directory to the libltdl search path so that xmlsec can find xmlsec1-openssl. */ - boost::filesystem::path lib = app_contents (); + boost::filesystem::path lib = directory_containing_executable().parent_path(); lib /= "Frameworks"; setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1); #endif @@ -823,7 +823,9 @@ remap (shared_ptr input, int output_channels, AudioMapping m shared_ptr mapped (new AudioBuffers (output_channels, input->frames())); mapped->make_silent (); - for (int i = 0; i < map.input_channels(); ++i) { + int to_do = min (map.input_channels(), input->channels()); + + for (int i = 0; i < to_do; ++i) { for (int j = 0; j < mapped->channels(); ++j) { if (map.get (i, static_cast (j)) > 0) { mapped->accumulate_channel (