rem: DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK state stopped" << endl);
add: ++current->j_stopped_rounds_rep;   if (current->is_running() == true && current->j_stopped_rounds_rep > 3) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: running, request stop" << endl); current->stop_request_rep++; current->engine_repp->command(ECA_ENGINE::ep_stop, 0.0f); }
context: static void eca_jack_process_timebase_slave(jack_nframes_t nframes, void *arg){#if ECA_JACK_TRANSPORT_API >= 3  AUDIO_IO_JACK_MANAGER* current = static_cast<AUDIO_IO_JACK_MANAGER*>(arg);  jack_transport_state_t jackstate;  jack_position_t jackpos;  bool need_mute = true;  jackstate = jack_transport_query(current->client_repp, &jackpos);   SAMPLE_SPECS::sample_pos_t enginepos = current->engine_repp->current_position_in_samples();  /* 1. engine locked for editing, do not touch! */  if (current->engine_repp->is_locked_for_editing() == true) {    DEBUG_CFLOW_STATEMENT(cerr << "current->engine_repp->is_locked_for_editing() == true\n");  }  /* 2. transport stopped or starting */  else if (jackstate == JackTransportStopped) {    DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK state stopped" << endl);  }  /* 3. transport stopped or starting */  else if (jackstate == JackTransportStarting) {    DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK state starting" << endl);  }  /* 4. transport rolling (or looping, both states are fine to us, as         is the case where state info is not available at all) */  else {    if (current->is_running() != true) {      DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): not running!" << endl);      eca_jack_sync_start_live_seek_to(jackstate, &jackpos, arg);    }    else {      if (enginepos == jackpos.frame) {	DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK running; correct position\n");	/* execute engine iteration */	eca_jack_process_engine_iteration(nframes, current);	current->jackslave_seekahead_target_rep = -1;	need_mute = false;      }      else {	DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_process_timebase_slave():  engine curpos '" << 			      current->engine_repp->current_position_in_samples() << 			      "' doesn't match JACK curpos '" << 			      jackpos.frame << "'!" << endl);	eca_jack_sync_start_live_seek_to(jackstate, &jackpos, arg);      }    }  }    if (need_mute == true) {    eca_jack_process_mute(nframes, current);  }#endif}