修复mp4录制使用相对时间戳导致不同步的bug

This commit is contained in:
xia-chu 2023-11-25 11:27:29 +08:00
parent 46c6ff038c
commit f6a97af55c
1 changed files with 9 additions and 5 deletions

View File

@ -170,9 +170,13 @@ void MP4MuxerInterface::stampSync() {
Stamp *audio = nullptr, *video = nullptr;
for (auto &pr : _codec_to_trackid) {
auto &stamp = pr.second.stamp;
// mp4录制时间戳不允许回退最大跳跃幅度500ms
stamp.enableRollback(false);
stamp.setMaxDelta(500);
switch (getTrackType((CodecId)pr.first)) {
case TrackAudio : audio = &pr.second.stamp; break;
case TrackVideo : video = &pr.second.stamp; break;
case TrackAudio: audio = &stamp; break;
case TrackVideo: video = &stamp; break;
default: break;
}
}