[FFmpeg-devel] [PATCH] avformat/avienc: Use AV_STRINGIFY for compile time constant

Anton Khirnov anton at khirnov.net
Mon Mar 16 12:00:47 EET 2020


Quoting Andreas Rheinhardt (2020-03-14 18:08:45)
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavformat/avienc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/avienc.c b/libavformat/avienc.c
> index 07e1c3319e..297d5b8964 100644
> --- a/libavformat/avienc.c
> +++ b/libavformat/avienc.c
> @@ -268,8 +268,8 @@ static int avi_write_header(AVFormatContext *s)
>      int padding;
>  
>      if (s->nb_streams > AVI_MAX_STREAM_COUNT) {
> -        av_log(s, AV_LOG_ERROR, "AVI does not support >%d streams\n",
> -               AVI_MAX_STREAM_COUNT);
> +        av_log(s, AV_LOG_ERROR, "AVI does not support "
> +               ">"AV_STRINGIFY(AVI_MAX_STREAM_COUNT)" streams\n");

Why? How does it make the code better? It's longer and less readable and
I'd think any decent compiler will already make that transformation.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list