Skip to content

Commit

Permalink
Remove redundant check.
Browse files Browse the repository at this point in the history
  • Loading branch information
chundonglinlin committed Feb 22, 2025
1 parent 957ee4c commit cbecd38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions trunk/src/app/srs_app_rtc_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,18 +908,18 @@ srs_error_t SrsRtcRtpBuilder::on_audio(SrsSharedPtrMessage* msg)
return srs_error_wrap(err, "format consume audio");
}

// Try to init codec when startup or codec changed.
if (format->acodec && (err = init_codec(format->acodec->id)) != srs_success) {
return srs_error_wrap(err, "init codec");
}

// 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;
}

// ts support audio codec: aac/mp3
// Try to init codec when startup or codec changed.
if ((err = init_codec(format->acodec->id)) != srs_success) {
return srs_error_wrap(err, "init codec");
}

// support audio codec: aac/mp3
SrsAudioCodecId acodec = format->acodec->id;
if (acodec != SrsAudioCodecIdAAC && acodec != SrsAudioCodecIdMP3) {
return err;
Expand Down

0 comments on commit cbecd38

Please sign in to comment.