mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 02:34:26 +08:00
修复时间戳回退导致超大mp4切片问题 (#3991)
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
当出现dts回退时,应该取frame->dts(), 即MIN, 非MAX
This commit is contained in:
parent
cc590254a6
commit
6729257eab
@ -126,7 +126,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
|
||||
if (_last_dts == 0 || _last_dts > frame->dts()) {
|
||||
// b帧情况下dts时间戳可能回退 [AUTO-TRANSLATED:1de38f77]
|
||||
// In the case of b-frames, the dts timestamp may regress
|
||||
_last_dts = MAX(frame->dts(), _last_dts);
|
||||
_last_dts = MIN(frame->dts(), _last_dts);
|
||||
}
|
||||
auto duration = 5u; // 默认至少一帧5ms
|
||||
if (frame->dts() > 0 && frame->dts() > _last_dts) {
|
||||
|
Loading…
Reference in New Issue
Block a user