From 3c684fa0cf25d7e08e87402620ea12c74e6af0c4 Mon Sep 17 00:00:00 2001 From: Jacob Su Date: Mon, 11 Nov 2024 09:44:52 +0800 Subject: [PATCH] Ignore RTC audio transcode error: AVERROR_INVALIDDATA. --- trunk/src/app/srs_app_rtc_codec.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_rtc_codec.cpp b/trunk/src/app/srs_app_rtc_codec.cpp index 1047d661df..1f5d8f42b8 100644 --- a/trunk/src/app/srs_app_rtc_codec.cpp +++ b/trunk/src/app/srs_app_rtc_codec.cpp @@ -336,7 +336,9 @@ 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) { + // https://github.com/ossrs/srs/issues/4224 + // ignore the AVERROR_INVALIDDATA error. + if (error < 0 && error != AVERROR_INVALIDDATA) { 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)); }