Skip to content

Commit 3215262

Browse files
committed
Ignore RTC audio transcode error: AVERROR_INVALIDDATA.
1 parent 7951bf3 commit 3215262

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

trunk/src/app/srs_app_rtc_codec.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,13 @@ srs_error_t SrsAudioTranscoder::decode_and_resample(SrsAudioFrame *pkt)
337337
char err_buf[AV_ERROR_MAX_STRING_SIZE] = {0};
338338
int error = avcodec_send_packet(dec_, dec_packet_);
339339
if (error < 0) {
340-
return srs_error_new(ERROR_RTC_RTP_MUXER, "submit to dec(%d,%s)", error,
341-
av_make_error_string(err_buf, AV_ERROR_MAX_STRING_SIZE, error));
340+
char* e_str = av_make_error_string(err_buf, AV_ERROR_MAX_STRING_SIZE, error);
341+
srs_warn("audio dec error(%d, %s)", error, e_str);
342+
// https://github.com/ossrs/srs/issues/4224
343+
// ignore the AVERROR_INVALIDDATA error.
344+
if (error != AVERROR_INVALIDDATA) {
345+
return srs_error_new(ERROR_RTC_RTP_MUXER, "submit to dec(%d,%s)", error, e_str);
346+
}
342347
}
343348

344349
new_pkt_pts_ = pkt->dts + pkt->cts;

0 commit comments

Comments
 (0)