    in_buf->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
    in_buf->nOffset = 0;
    in_buf->nTimeStamp = extra->timestamp_eof/1000LL;  // OMX_TICKS, in microseconds
  
    err = OMX_EmptyThisBuffer(s->handle, in_buf);
    assert(err == OMX_ErrorNone);
  
 
</s> remove #ifdef QCOM2
    s->ofmt_ctx->oformat->flags = AVFMT_TS_NONSTRICT;
#endif
 </s> add 
  s->last_t = in_buf->nTimeStamp;
    in_buf->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
    in_buf->nOffset = 0;
    in_buf->nTimeStamp = extra->timestamp_eof/1000LL;  // OMX_TICKS, in microseconds
  s->last_t = in_buf->nTimeStamp;
  
    err = OMX_EmptyThisBuffer(s->handle, in_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