From 59018254c7a178e4650ef63016493c75383a2076 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 18 Feb 2022 13:53:19 +0100 Subject: [PATCH] avcodec/openh264: return (DE|EN)CODER_NOT_FOUND if version check fails A cosmetic change only, it basically just changes the user facing error message to clients that interpret the errors to something that makes sense. Signed-off-by: Andreas Schneider Signed-off-by: Marton Balint --- libavcodec/libopenh264dec.c | 2 +- libavcodec/libopenh264enc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index b3e522c31f..007f86b619 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -57,7 +57,7 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) WelsTraceCallback callback_function; if ((err = ff_libopenh264_check_version(avctx)) < 0) - return err; + return AVERROR_DECODER_NOT_FOUND; if (WelsCreateDecoder(&s->decoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index f31ed2d4ca..db252aace1 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -138,7 +138,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) AVCPBProperties *props; if ((err = ff_libopenh264_check_version(avctx)) < 0) - return err; + return AVERROR_ENCODER_NOT_FOUND; if (WelsCreateSVCEncoder(&s->encoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n");