Skip to content

Commit

Permalink
For #1506, ignore video when codec is unknown.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 5, 2019
1 parent 65c6659 commit 52c6c7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/*.conf
/*.txt
/*.flv
/*.mp4
/doc/frozen*.flv
/doc/kungfupanda*.flv
/doc/time*.flv
Expand Down
15 changes: 13 additions & 2 deletions trunk/src/app/srs_app_hls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,12 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
if (!enabled) {
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();
Expand All @@ -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;
Expand Down Expand Up @@ -1251,7 +1256,13 @@ srs_error_t SrsHls::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* forma
if (!enabled) {
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();

Expand Down

1 comment on commit 52c6c7c

@winlinvip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #1506

Please sign in to comment.