Skip to content

Commit

Permalink
Ignore RTC audio transcode error: AVERROR_INVALIDDATA.
Browse files Browse the repository at this point in the history
  • Loading branch information
suzp1984 committed Nov 11, 2024
1 parent 7951bf3 commit 3215262
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions trunk/src/app/srs_app_rtc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,13 @@ srs_error_t SrsAudioTranscoder::decode_and_resample(SrsAudioFrame *pkt)
char err_buf[AV_ERROR_MAX_STRING_SIZE] = {0};
int error = avcodec_send_packet(dec_, dec_packet_);
if (error < 0) {
return srs_error_new(ERROR_RTC_RTP_MUXER, "submit to dec(%d,%s)", error,
av_make_error_string(err_buf, AV_ERROR_MAX_STRING_SIZE, error));
char* e_str = av_make_error_string(err_buf, AV_ERROR_MAX_STRING_SIZE, error);
srs_warn("audio dec error(%d, %s)", error, e_str);
// https://github.com/ossrs/srs/issues/4224
// ignore the AVERROR_INVALIDDATA error.
if (error != AVERROR_INVALIDDATA) {
return srs_error_new(ERROR_RTC_RTP_MUXER, "submit to dec(%d,%s)", error, e_str);
}
}

new_pkt_pts_ = pkt->dts + pkt->cts;
Expand Down

0 comments on commit 3215262

Please sign in to comment.