mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix hls media codec info bug, ignore nal_unit_type 7/8/9. 0.9.152
This commit is contained in:
parent
21a75924ad
commit
f895523ac6
1 changed files with 14 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue