diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 8721a1982..9fb4a049b 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -1403,7 +1403,17 @@ private: bool OnCmdLineParsed (wxCmdLineParser& parser) override { if (parser.GetParamCount() > 0) { - _dcp_to_load = wx_to_std (parser.GetParam (0)); + auto path = boost::filesystem::path(wx_to_std(parser.GetParam(0))); + /* Go at most two directories higher looking for a DCP that contains the file + * that was passed in. + */ + for (int i = 0; i < 2; ++i) { + if (dcp::filesystem::is_directory(path) && contains_assetmap(path)) { + _dcp_to_load = path; + break; + } + path = path.parent_path(); + } } wxString config; |
