diff mbox series

[FFmpeg-devel] avcodec/allcodecs: Don't include libx264 twice in the list of codecs

Message ID HE1PR0301MB21544912BB67CF332BE998798F539@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Headers show
Series [FFmpeg-devel] avcodec/allcodecs: Don't include libx264 twice in the list of codecs
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate fail Make fate failed
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

Andreas Rheinhardt May 11, 2021, 1:25 a.m. UTC
Since a247ac640df3da573cd661065bf53f37863e2b46, allcodecs.c contained
two lines that matched the regex used by find_filters_extern in
configure; as a result, libx264 appeared twice the list of codecs
(if enabled).

Fix this by using only one matching line by adding a preprocessor define
for the part that differed in the two old lines: The const qualifier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/allcodecs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Andreas Rheinhardt May 12, 2021, 4:03 a.m. UTC | #1
Andreas Rheinhardt:
> Since a247ac640df3da573cd661065bf53f37863e2b46, allcodecs.c contained
> two lines that matched the regex used by find_filters_extern in
> configure; as a result, libx264 appeared twice the list of codecs
> (if enabled).
> 
> Fix this by using only one matching line by adding a preprocessor define
> for the part that differed in the two old lines: The const qualifier.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/allcodecs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 0b15b59364..a68bbd413e 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -766,10 +766,11 @@ extern const AVCodec ff_libx262_encoder;
>  #if CONFIG_LIBX264_ENCODER
>  #include <x264.h>
>  #if X264_BUILD < 153
> -extern AVCodec ff_libx264_encoder;
> +#define X264_CONST
>  #else
> -extern const AVCodec ff_libx264_encoder;
> +#define X264_CONST const
>  #endif
> +extern X264_CONST AVCodec ff_libx264_encoder;
>  #endif
>  extern const AVCodec ff_libx264rgb_encoder;
>  extern AVCodec ff_libx265_encoder;
> 
Changed this locally to LIBX264_CONST in order not to invade the
namespace used by libx264 itself. Will apply tomorrow unless there are
objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0b15b59364..a68bbd413e 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -766,10 +766,11 @@  extern const AVCodec ff_libx262_encoder;
 #if CONFIG_LIBX264_ENCODER
 #include <x264.h>
 #if X264_BUILD < 153
-extern AVCodec ff_libx264_encoder;
+#define X264_CONST
 #else
-extern const AVCodec ff_libx264_encoder;
+#define X264_CONST const
 #endif
+extern X264_CONST AVCodec ff_libx264_encoder;
 #endif
 extern const AVCodec ff_libx264rgb_encoder;
 extern AVCodec ff_libx265_encoder;