From a050f38cc9cba243fd9486976cf3a3ecad7bc30b Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sun, 11 May 2025 11:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=B5=8F=E8=A7=88=E5=99=A8we?= =?UTF-8?q?brtc=20g711=E9=9F=B3=E9=A2=91=E6=92=AD=E6=94=BE=E6=95=88?= =?UTF-8?q?=E6=9E=9C=20(#4280=20#4282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For chrome (136.0.7103.93) --- ext-codec/G711Rtp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext-codec/G711Rtp.cpp b/ext-codec/G711Rtp.cpp index d60e7362..198a1103 100644 --- a/ext-codec/G711Rtp.cpp +++ b/ext-codec/G711Rtp.cpp @@ -38,7 +38,8 @@ bool G711RtpEncoder::inputFrame(const Frame::Ptr &frame) { _buffer.append(ptr, size); while (_buffer.size() >= _pkt_bytes) { - RtpCodec::inputRtp(getRtpInfo().makeRtp(TrackAudio, _buffer.data(), _pkt_bytes, false, in_pts), false); + auto tmp = (in_pts+_pkt_dur_ms-1)/_pkt_dur_ms*_pkt_dur_ms; + RtpCodec::inputRtp(getRtpInfo().makeRtp(TrackAudio, _buffer.data(), _pkt_bytes, false, tmp), false); in_pts += _pkt_dur_ms; _buffer.erase(0, _pkt_bytes); }