diff --git a/ngx_rtmp_record_module.c b/ngx_rtmp_record_module.c index a817c6e..e54a30b 100644 --- a/ngx_rtmp_record_module.c +++ b/ngx_rtmp_record_module.c @@ -892,6 +892,13 @@ ngx_rtmp_record_write_frame(ngx_rtmp_session_t *s, timestamp = h->timestamp - rctx->epoch; + if ((int32_t) timestamp < 0) { + ngx_log_debug2(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, + "record: %V cut timestamp=%D", &rracf->id, timestamp); + + timestamp = 0; + } + /* write tag header */ ph = hdr;