1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #635, support IDR and NonIDR(open-gop).

This commit is contained in:
winlin 2017-01-10 17:17:23 +08:00
parent c9a71b7fb2
commit 4104f25069
4 changed files with 91 additions and 64 deletions

View file

@ -1071,7 +1071,7 @@ int SrsHlsCache::write_video(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
// b. always reap when not wait keyframe.
if (!muxer->wait_keyframe() || sample->frame_type == SrsCodecVideoAVCFrameKeyFrame) {
// when wait keyframe, there must exists idr frame in sample, or NonIDR(open gop) specified.
if (!sample->has_non_idr && !sample->has_idr && muxer->wait_keyframe()) {
if (!sample->open_gop && !sample->has_idr && muxer->wait_keyframe()) {
srs_warn("hls: ts starts without IDR, first nalu=%d, idr=%d", sample->first_nalu_type, sample->has_idr);
}
@ -1274,6 +1274,8 @@ void SrsHls::on_unpublish()
srs_error("ignore m3u8 muxer flush/close audio failed. ret=%d", ret);
}
sample->reset();
hls_enabled = false;
}