diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-23 23:04:46 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-23 23:04:46 +0200 |
| commit | 61b2026a6d676125f6b7e02d8a81e9aed59e9ce8 (patch) | |
| tree | a16ab1b2124558625e8c3bb5d473fb7ddf5681ee /src | |
| parent | 1ac377eb46e4497d6f547f6d498d8c867343b331 (diff) | |
Don't react so strongly to failure to bind the play server socket when starting a second player.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index c0587ed55..112f2c065 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -1150,8 +1150,15 @@ private: } _frame->Show (); - PlayServer* server = new PlayServer (_frame); - new thread (boost::bind (&PlayServer::run, server)); + try { + auto server = new PlayServer (_frame); + new thread (boost::bind (&PlayServer::run, server)); + } catch (std::exception& e) { + /* This is not the end of the world; probably a failure to bind the server socket + * because there's already another player running. + */ + LOG_DEBUG_PLAYER ("Failed to start play server (%1)", e.what()); + } if (!_dcp_to_load.empty() && boost::filesystem::is_directory (_dcp_to_load)) { try { |
