winlin

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

@@ -1256,6 +1256,19 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample) @@ -1256,6 +1256,19 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample)
1256 if (nal_unit_type == 1) { 1256 if (nal_unit_type == 1) {
1257 sps_pps_sent = false; 1257 sps_pps_sent = false;
1258 } 1258 }
  1259 +
  1260 + // 6: Supplemental enhancement information (SEI) sei_rbsp( ), page 61
  1261 + // @see: ngx_rtmp_hls_append_aud
  1262 + if (!aud_sent) {
  1263 + if (nal_unit_type == 9) {
  1264 + aud_sent = true;
  1265 + }
  1266 + if (nal_unit_type == 1 || nal_unit_type == 5 || nal_unit_type == 6) {
  1267 + // for type 6, append a aud with type 9.
  1268 + vb->append(aud_nal, sizeof(aud_nal));
  1269 + }
  1270 + }
  1271 +
1259 // 5: Coded slice of an IDR picture. 1272 // 5: Coded slice of an IDR picture.
1260 // insert sps/pps before IDR or key frame is ok. 1273 // insert sps/pps before IDR or key frame is ok.
1261 if (nal_unit_type == 5 && !sps_pps_sent) { 1274 if (nal_unit_type == 5 && !sps_pps_sent) {
@@ -1276,12 +1289,7 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample) @@ -1276,12 +1289,7 @@ int SrsHlsCache::cache_video(SrsAvcAacCodec* codec, SrsCodecSample* sample)
1276 vb->append(codec->pictureParameterSetNALUnit, codec->pictureParameterSetLength); 1289 vb->append(codec->pictureParameterSetNALUnit, codec->pictureParameterSetLength);
1277 } 1290 }
1278 } 1291 }
1279 - // 6: Supplemental enhancement information (SEI) sei_rbsp( ), page 61  
1280 - // @see: ngx_rtmp_hls_append_aud  
1281 - if (nal_unit_type == 6 && !aud_sent) {  
1282 - // for type 6, append a aud with type 9.  
1283 - vb->append(aud_nal, sizeof(aud_nal));  
1284 - } 1292 +
1285 // 7-9, ignore, @see: ngx_rtmp_hls_video 1293 // 7-9, ignore, @see: ngx_rtmp_hls_video
1286 if (nal_unit_type >= 7 && nal_unit_type <= 9) { 1294 if (nal_unit_type >= 7 && nal_unit_type <= 9) {
1287 continue; 1295 continue;