Merge pull request #10726 from oleg0421/rdpecam_client_mjpeg_fix

RDPECAM client MJPEG decoder fix to skip corrupted frames
This commit is contained in:
akallabeth 2024-10-12 08:37:08 +02:00 committed by GitHub
commit bbc27d53db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -289,6 +289,10 @@ static BOOL ecam_init_mjpeg_decoder(CameraDeviceStream* stream)
stream->avContext->width = stream->currMediaType.Width;
stream->avContext->height = stream->currMediaType.Height;
/* AV_EF_EXPLODE flag is to abort decoding on minor error detection,
* return error, so we can skip corrupted frames, if any */
stream->avContext->err_recognition |= AV_EF_EXPLODE;
if (avcodec_open2(stream->avContext, avcodec, NULL) < 0)
{
WLog_ERR(TAG, "avcodec_open2 failed");