13
0

Prevent infinite loops

This commit is contained in:
Roy Vegard Ovesen 2013-04-03 16:18:42 +02:00
parent d94a3c2bd0
commit 810a603fb2

View File

@ -666,16 +666,21 @@ ARDOUR_UI::startup ()
if (!nsm->init (nsm_url)) {
nsm->announce (PROGRAM_NAME, ":dirty:", "ardour3");
unsigned int i = 0;
// wait for announce reply from nsm server
do {
for ( i = 0; i < 5000; ++i) {
nsm->check ();
usleep (10);
} while (!nsm->is_active ());
usleep (i);
if (nsm->is_active())
break;
}
// wait for open command from nsm server
do {
for ( i = 0; i < 5000; ++i) {
nsm->check ();
usleep (10);
} while (!nsm->client_id ());
usleep (1000);
if (nsm->client_id ())
break;
}
if (_session && nsm) {
_session->set_nsm_state( nsm->is_active() );