[FFmpeg-cvslog] avcodec/openh264: return (DE|EN)CODER_NOT_FOUND if version check fails

Andreas Schneider git at videolan.org
Fri Jul 8 01:50:44 EEST 2022


ffmpeg | branch: master | Andreas Schneider <asn at cryptomilk.org> | Fri Feb 18 13:53:19 2022 +0100| [59018254c7a178e4650ef63016493c75383a2076] | committer: Marton Balint

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 <asn at cryptomilk.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59018254c7a178e4650ef63016493c75383a2076
---

 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");



More information about the ffmpeg-cvslog mailing list