From 8289aa7e880f436cbe8070f90467412eece5db05 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sun, 23 Nov 2025 11:41:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B9=E6=8D=AEpts?= =?UTF-8?q?=E7=94=9F=E6=88=90dts=E6=97=B6=E9=97=B4=E6=88=B3=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20(#4552)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Stamp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/Stamp.cpp b/src/Common/Stamp.cpp index 817b7b6b..eb1e335d 100644 --- a/src/Common/Stamp.cpp +++ b/src/Common/Stamp.cpp @@ -320,7 +320,7 @@ bool DtsGenerator::getDts_l(uint64_t pts, uint64_t &dts) { // Put pts into the sorting cache queue, the maximum cache queue is equal to the number of consecutive B frames _pts_sorter.emplace(pts); - if (_sorter_max_size && _pts_sorter.size() > _sorter_max_size) { + if (_sorter_max_size > 1 && _pts_sorter.size() > _sorter_max_size) { // 如果启用了pts排序(意味着存在B帧),并且pts排序缓存列队长度大于连续B帧个数, [AUTO-TRANSLATED:002c0d03] // If pts sorting is enabled (meaning there are B frames), and the length of the pts sorting cache queue is greater than the number of consecutive B frames, // 意味着后续的pts都会比最早的pts大,那么说明可以取出最早的pts了,这个pts将当做该帧的dts基准 [AUTO-TRANSLATED:86b8f679]