mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 02:38:10 +08:00
完善相对时间戳逻辑, 完善同步机制, 解决相对时间戳不同步的问题
默认禁止时间戳回退并设置最大跳跃幅度为300毫秒 rtsp恢复产生ntp时间戳 由于绝对时间戳可能跳跃回退,之前在求相对时间戳时会导致音视频不同步。 现在求相对时间戳逻辑经过修改,已经支持同步功能,所以恢复rtp ntp时间戳逻辑
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
using namespace std;
|
||||
using namespace toolkit;
|
||||
|
||||
#define ENABLE_NTP_STAMP 0
|
||||
#define ENABLE_NTP_STAMP 1
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
@@ -78,6 +78,10 @@ bool RtspMuxer::addTrack(const Track::Ptr &track) {
|
||||
//添加其sdp
|
||||
_sdp.append(sdp->getSdp());
|
||||
trySyncTrack();
|
||||
|
||||
// rtp的时间戳是pts,允许回退
|
||||
_stamp[TrackAudio].enableRollback(true);
|
||||
_stamp[TrackVideo].enableRollback(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user