From 10eb063f6349c55930cef892f4d0e1086409fe51 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 27 Jul 2021 10:16:35 +0800 Subject: [PATCH] =?UTF-8?q?rtp=E6=97=B6=E9=97=B4=E6=88=B3=E9=87=87?= =?UTF-8?q?=E7=94=A8pts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/PSEncoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rtp/PSEncoder.cpp b/src/Rtp/PSEncoder.cpp index 5195626d..c6d64cac 100644 --- a/src/Rtp/PSEncoder.cpp +++ b/src/Rtp/PSEncoder.cpp @@ -124,7 +124,7 @@ void PSEncoder::inputFrame(const Frame::Ptr &frame) { _frame_merger.inputFrame(frame, [&](uint32_t dts, uint32_t pts, const Buffer::Ptr &buffer, bool have_idr) { track_info.stamp.revise(dts, pts, dts_out, pts_out); //取视频时间戳为TS的时间戳 - _timestamp = (uint32_t) dts_out; + _timestamp = (uint32_t) pts_out; ps_muxer_input(_muxer.get(), track_info.track_id, have_idr ? 0x0001 : 0, pts_out * 90LL, dts_out * 90LL, buffer->data(), buffer->size()); }); @@ -165,7 +165,7 @@ PSEncoderImp::~PSEncoderImp() { } void PSEncoderImp::onPS(uint32_t stamp, void *packet, size_t bytes) { - _rtp_encoder->inputFrame(std::make_shared((char *) packet, bytes, stamp)); + _rtp_encoder->inputFrame(std::make_shared((char *) packet, bytes, stamp, stamp)); } }//namespace mediakit