Skip to content

Commit

Permalink
[codec,dsp] ignore encoder errors
Browse files Browse the repository at this point in the history
Due to the AAC encoder sometimes returning errors (due to some internal
foobar) ignore these and just move on to the next packet to encode.
  • Loading branch information
akallabeth committed Feb 22, 2025
1 parent 73e26b6 commit 06a5bd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libfreerdp/codec/dsp_ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,16 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* WINPR_RESTRICT context, AVFrame*
if (ret < 0)
{
const char* err = av_err2str(ret);
// Ignore errors: AAC encoder sometimes returns -22
// The log message from ffmpeg is '[aac @ 0x7f140db753c0] Input contains (near) NaN/+-Inf'
if (ret == AVERROR(EINVAL))
{
WLog_DBG(TAG, "Error submitting the packet to the encoder %s [%d], ignoring", err, ret);
return TRUE;
}

WLog_ERR(TAG, "Error submitting the packet to the encoder %s [%d]", err, ret);

return FALSE;
}

Expand Down

0 comments on commit 06a5bd1

Please sign in to comment.