mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
完善
This commit is contained in:
parent
a400b39fab
commit
892734bfd8
@ -79,11 +79,13 @@ void MP4Muxer::onTrackFrame(const Frame::Ptr &frame) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(frame->getTrackType() == TrackVideo){
|
if(!_started){
|
||||||
if(!_started && !frame->keyFrame()){
|
//还没开始
|
||||||
//第一帧必须是I帧,防止花屏
|
if(frame->getTrackType() != TrackVideo || !frame->keyFrame()){
|
||||||
|
//如果首帧是音频或者是视频但是不是i帧,那么不能开始写文件
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//开始写文件
|
||||||
_started = true;
|
_started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user