[FFmpeg-devel] [PATCH] avcodec/libtheoraenc: Do not use invalid error code

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Sep 2 12:27:05 EEST 2022


Paul B Mahol:
> On Thu, Sep 1, 2022 at 11:50 PM Andreas Rheinhardt <
> andreas.rheinhardt at outlook.com> wrote:
> 
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
>> ---
>>  libavcodec/libtheoraenc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> So it currently does not compile or?
> 

This is in an #else that has apparently never been tested.
800841fd0c6c686c62bdd482e46b6c61b72fa531 (November 2009) added the
#ifdefery for compatibility with libtheora 1.0 and
8cb76ef275f7e4be049ac7d6dbfc23186ec73631 (Nov 2012) improved the
returned error codes and added the mistake. We could also drop support
for libtheora 1.0.

> 
> 
>> diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
>> index 22835553d6..92bf3a133c 100644
>> --- a/libavcodec/libtheoraenc.c
>> +++ b/libavcodec/libtheoraenc.c
>> @@ -119,7 +119,7 @@ static int get_stats(AVCodecContext *avctx, int eos)
>>      return 0;
>>  #else
>>      av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
>> -    return AVERROR(ENOSUP);
>> +    return AVERROR(ENOTSUP);
>>  #endif
>>  }
>>
>> @@ -158,7 +158,7 @@ static int submit_stats(AVCodecContext *avctx)
>>      return 0;
>>  #else
>>      av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
>> -    return AVERROR(ENOSUP);
>> +    return AVERROR(ENOTSUP);
>>  #endif
>>  }
>>
>> --
>> 2.34.1
>>


More information about the ffmpeg-devel mailing list