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

For #1506, ignore video when codec is unknown.

This commit is contained in:
winlin 2019-12-05 19:21:43 +08:00
parent 65c66592e9
commit 52c6c7c45d
2 changed files with 14 additions and 2 deletions

1
trunk/.gitignore vendored
View file

@ -2,6 +2,7 @@
/*.conf
/*.txt
/*.flv
/*.mp4
/doc/frozen*.flv
/doc/kungfupanda*.flv
/doc/time*.flv

View file

@ -1195,6 +1195,12 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
return err;
}
// Ignore if no format->acodec, it means the codec is not parsed, or unknown codec.
// @issue https://github.com/ossrs/srs/issues/1506#issuecomment-562079474
if (!format->acodec) {
return err;
}
// update the hls time, for hls_dispose.
last_update_time = srs_get_system_time();
@ -1202,7 +1208,6 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
SrsAutoFree(SrsSharedPtrMessage, audio);
// ts support audio codec: aac/mp3
srs_assert(format->acodec);
SrsAudioCodecId acodec = format->acodec->id;
if (acodec != SrsAudioCodecIdAAC && acodec != SrsAudioCodecIdMP3) {
return err;
@ -1252,6 +1257,12 @@ srs_error_t SrsHls::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* forma
return err;
}
// Ignore if no format->vcodec, it means the codec is not parsed, or unknown codec.
// @issue https://github.com/ossrs/srs/issues/1506#issuecomment-562079474
if (!format->vcodec) {
return err;
}
// update the hls time, for hls_dispose.
last_update_time = srs_get_system_time();