Don't react so strongly to failure to bind the play server socket when starting a...
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index c0587ed5557efcf64ec9acf48871e7fa6f422065..112f2c0654b463ef711d414188a7cf9605f7fdac 100644 (file)
@@ -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 {