mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
mp4切片逻辑提高对音视频交织性差的流的兼容性能
This commit is contained in:
parent
19c7d1c406
commit
a16b6cbc59
@ -96,6 +96,8 @@ void MP4Recorder::closeFile() {
|
||||
}
|
||||
|
||||
bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
|
||||
if (!(_have_video && frame->getTrackType() == TrackAudio)) {
|
||||
//如果有视频且输入的是音频,那么应该忽略切片逻辑
|
||||
if (_last_dts == 0 || _last_dts > frame->dts()) {
|
||||
//极少情况下dts时间戳可能回退
|
||||
_last_dts = frame->dts();
|
||||
@ -110,6 +112,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
|
||||
_last_dts = 0;
|
||||
createFile();
|
||||
}
|
||||
}
|
||||
|
||||
if (_muxer) {
|
||||
//生成mp4文件
|
||||
|
Loading…
Reference in New Issue
Block a user