From 6729257eabfe26a0df1657d8f9d034cb31b6cba9 Mon Sep 17 00:00:00 2001 From: wuxingzhong Date: Thu, 31 Oct 2024 20:11:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E5=AF=BC=E8=87=B4=E8=B6=85=E5=A4=A7mp4?= =?UTF-8?q?=E5=88=87=E7=89=87=E9=97=AE=E9=A2=98=20(#3991)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当出现dts回退时,应该取frame->dts(), 即MIN, 非MAX --- src/Record/MP4Recorder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Record/MP4Recorder.cpp b/src/Record/MP4Recorder.cpp index cd9e0e53..b775da13 100644 --- a/src/Record/MP4Recorder.cpp +++ b/src/Record/MP4Recorder.cpp @@ -126,7 +126,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) { if (_last_dts == 0 || _last_dts > frame->dts()) { // b帧情况下dts时间戳可能回退 [AUTO-TRANSLATED:1de38f77] // In the case of b-frames, the dts timestamp may regress - _last_dts = MAX(frame->dts(), _last_dts); + _last_dts = MIN(frame->dts(), _last_dts); } auto duration = 5u; // 默认至少一帧5ms if (frame->dts() > 0 && frame->dts() > _last_dts) {