rem: if (current->jackslave_seekahead_target_rep == -1) {
add: if (current->jackslave_seekahead_target_rep == -1 && enginepos != pos->frame) {
context: static int eca_jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg){#if ECA_JACK_TRANSPORT_API >= 3  // DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_SYNC: entering...");  AUDIO_IO_JACK_MANAGER* current = static_cast<AUDIO_IO_JACK_MANAGER*>(arg);  int result = 1; /* ready for rolling */  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");    result = 0;  }  /* 2. transport stopped */  else if (state == JackTransportStopped) {    DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK stopped" << endl);    if (current->jackslave_seekahead_target_rep == -1) {      DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: stopped - starting seek to "			    << pos->frame << "." << endl);      eca_jack_sync_start_seek_to(state, pos, arg);    }    result = 0;  }  /* 3. transport  starting (or looping, all these states are fine to us, as         is the case where state info is not available at all) */  else if (state == JackTransportStarting) {    DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK starting" << endl);    if (enginepos == pos->frame) {      DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK running; correct position\n");      result = 1;      current->jackslave_seekahead_target_rep = -1;    }    else if (current->jackslave_seekahead_target_rep == -1) {      DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: starting - new seek to "			    << pos->frame << "." << endl);      eca_jack_sync_start_seek_to(state, pos, arg);      result = 0;    }    else {      DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: still seeking, pos=" 			    << pos->frame 			    << ", enginepos=" << enginepos << "." << endl);      if (pos->frame != static_cast<unsigned long>(current->jackslave_seekahead_target_rep)) {	eca_jack_sync_start_seek_to(state, pos, arg);      }      result = 0;    }  }  /* 4. slow-start timeout elapsed; transport forced to rolling */  else {    DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK running, forced, trying to catch up" << endl);    eca_jack_sync_start_live_seek_to(state, pos, arg);  }  return result;#endif}