兼容dts时间戳回退导致录像切片异常的问题

This commit is contained in:
ziyue 2021-10-20 17:38:11 +08:00
parent 2422285829
commit 0e0608dc27

View File

@ -98,7 +98,7 @@ void MP4Recorder::closeFile() {
} }
bool MP4Recorder::inputFrame(const Frame::Ptr &frame) { bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
if (_last_dts == 0) { if (_last_dts == 0 || _last_dts > frame->dts()) {
//极少情况下dts时间戳可能回退 //极少情况下dts时间戳可能回退
_last_dts = frame->dts(); _last_dts = frame->dts();
} }