fix hls media codec info bug, ignore nal_unit_type 7/8/9. 0.9.152

pull/133/head
winlin 11 years ago
parent 21a75924ad
commit f895523ac6

@ -1256,6 +1256,19 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample)
if (nal_unit_type == 1) {
sps_pps_sent = false;
}
// 6: Supplemental enhancement information (SEI) sei_rbsp( ), page 61
// @see: ngx_rtmp_hls_append_aud
if (!aud_sent) {
if (nal_unit_type == 9) {
aud_sent = true;
}
if (nal_unit_type == 1 || nal_unit_type == 5 || nal_unit_type == 6) {
// for type 6, append a aud with type 9.
vb->append(aud_nal, sizeof(aud_nal));
}
}
// 5: Coded slice of an IDR picture.
// insert sps/pps before IDR or key frame is ok.
if (nal_unit_type == 5 && !sps_pps_sent) {
@ -1276,12 +1289,7 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample)
vb->append(codec->pictureParameterSetNALUnit, codec->pictureParameterSetLength);
}
}
// 6: Supplemental enhancement information (SEI) sei_rbsp( ), page 61
// @see: ngx_rtmp_hls_append_aud
if (nal_unit_type == 6 && !aud_sent) {
// for type 6, append a aud with type 9.
vb->append(aud_nal, sizeof(aud_nal));
}
// 7-9, ignore, @see: ngx_rtmp_hls_video
if (nal_unit_type >= 7 && nal_unit_type <= 9) {
continue;

Loading…
Cancel
Save