    }
  
    // give omx back the buffer
    err = OMX_FillThisBuffer(s->handle, out_buf);
    assert(err == OMX_ErrorNone);
  }
  
 
</s> remove #ifdef QCOM2
    s->ofmt_ctx->oformat->flags = AVFMT_TS_NONSTRICT;
#endif
 </s> add 
#ifdef QCOM2
  if ((out_buf->nFlags & OMX_BUFFERFLAG_EOS) ||
      (out_buf->nFlags & OMX_BUFFERFLAG_CODECCONFIG)) {
    out_buf->nTimeStamp = 0;
  }
#endif
    }
  
    // give omx back the buffer
#ifdef QCOM2
  if ((out_buf->nFlags & OMX_BUFFERFLAG_EOS) ||
      (out_buf->nFlags & OMX_BUFFERFLAG_CODECCONFIG)) {
    out_buf->nTimeStamp = 0;
  }
#endif
    err = OMX_FillThisBuffer(s->handle, out_buf);
    assert(err == OMX_ErrorNone);
  }
  
keep keep add keep keep keep keep
 Fix random encoder lockups (#2707)

* gbk

* surrrely not

* finalize

* such nuance, such nuisance

* this is done automatically

* add back

* give back 0

* simplify

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/loggerd/encoder.c