  
    while (!QThread::currentThread()->isInterruptionRequested()) {
      if (!vipc_client || cur_stream_type != stream_type) {
        clearFrames();
        cur_stream_type = stream_type;
        vipc_client.reset(new VisionIpcClient(stream_name, cur_stream_type, false));
      }
  
      if (!vipc_client->connected) {
        clearFrames();
        if (!vipc_client->connect(false)) {
 
</s> remove     if (!vipc_client || cur_stream_type != stream_type) {
 </s> add     if (!vipc_client || cur_stream != requested_stream_type) { </s> remove   VisionStreamType cur_stream_type = stream_type;
 </s> add   VisionStreamType cur_stream = requested_stream_type; </s> remove   }
  if (s->worldObjectsVisible()) {
    if (sm.updated("modelV2")) {
      update_model(s, sm["modelV2"].getModelV2());
    }
    if (sm.updated("radarState") && sm.rcv_frame("modelV2") > s->scene.started_frame) {
      update_leads(s, sm["radarState"].getRadarState(), sm["modelV2"].getModelV2().getPosition());
    }
 </s> add     scene.calibration_wide_valid = wfde_list.size() == 3; </s> remove 
  if (sm.updated("carState")) {
    float v_ego = sm["carState"].getCarState().getVEgo();
    // TODO: support replays without ecam by using fcam
    // Wide or narrow cam dependent on speed
    if ((v_ego < 10) || s->wide_cam_only) {
      scene.wide_cam = true;
    } else if (v_ego > 15) {
      scene.wide_cam = false;
    }
  }
 </s> add 
      qDebug() << "connecting to stream " << requested_stream_type << ", was connected to " << cur_stream;
      cur_stream = requested_stream_type;;
      vipc_client.reset(new VisionIpcClient(stream_name, cur_stream, false));
  
    while (!QThread::currentThread()->isInterruptionRequested()) {
      if (!vipc_client || cur_stream_type != stream_type) {
        clearFrames();
      qDebug() << "connecting to stream " << requested_stream_type << ", was connected to " << cur_stream;
      cur_stream = requested_stream_type;;
      vipc_client.reset(new VisionIpcClient(stream_name, cur_stream, false));
      qDebug() << "connecting to stream " << requested_stream_type << ", was connected to " << cur_stream;
      cur_stream = requested_stream_type;;
      vipc_client.reset(new VisionIpcClient(stream_name, cur_stream, false));
      }
  
      if (!vipc_client->connected) {
        clearFrames();
        if (!vipc_client->connect(false)) {
keep keep keep keep replace replace keep keep keep keep keep
 UI: draw onroad objects on right frame (#26306)

* update before draw

* fix a lot of janky

* fix more flicker

* cleanup

* fix flicker when opening settings

* simplify 
selfdrive/ui/qt/widgets/cameraview.cc