diff mbox series

[FFmpeg-devel,1/3] avcodec/adpcmenc: don't share a single AVClass between multiple AVCodecs.

Message ID 20210401113449.12680-1-zane@zanevaniperen.com
State Accepted
Commit aa1cfe05a5778db3c4af400e98ebfc9d67136706
Headers show
Series [FFmpeg-devel,1/3] avcodec/adpcmenc: don't share a single AVClass between multiple AVCodecs.
Related show

Checks

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

Commit Message

Zane van Iperen April 1, 2021, 11:34 a.m. UTC
Temporary fix until AVClass::child_class_next is gone.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavcodec/adpcmenc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

James Almer April 1, 2021, 1:24 p.m. UTC | #1
On 4/1/2021 8:34 AM, Zane van Iperen wrote:
> Temporary fix until AVClass::child_class_next is gone.
> 
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
> ---
>   libavcodec/adpcmenc.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
> index 78600735cf..58308dae47 100644
> --- a/libavcodec/adpcmenc.c
> +++ b/libavcodec/adpcmenc.c
> @@ -959,14 +959,14 @@ static const AVOption options[] = {
>       { NULL }
>   };
>   
> -static const AVClass adpcm_encoder_class = {
> -    .class_name = "ADPCM Encoder",
> -    .item_name  = av_default_item_name,
> -    .option     = options,
> -    .version    = LIBAVUTIL_VERSION_INT,
> -};
> -
>   #define ADPCM_ENCODER(id_, name_, sample_fmts_, capabilities_, long_name_) \
> +static const AVClass name_ ## _encoder_class = {                           \
> +    .class_name = #name_,                                                  \
> +    .item_name  = av_default_item_name,                                    \
> +    .option     = options,                                                 \
> +    .version    = LIBAVUTIL_VERSION_INT,                                   \
> +};                                                                         \
> +                                                                           \
>   AVCodec ff_ ## name_ ## _encoder = {                                       \
>       .name           = #name_,                                              \
>       .long_name      = NULL_IF_CONFIG_SMALL(long_name_),                    \
> @@ -979,7 +979,7 @@ AVCodec ff_ ## name_ ## _encoder = {                                       \
>       .sample_fmts    = sample_fmts_,                                        \
>       .capabilities   = capabilities_,                                       \
>       .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \
> -    .priv_class     = &adpcm_encoder_class,                                \
> +    .priv_class     = &name_ ## _encoder_class,                            \
>   }
>   
>   ADPCM_ENCODER(AV_CODEC_ID_ADPCM_ARGO,    adpcm_argo,    sample_fmts_p, 0,                             "ADPCM Argonaut Games");

LGTM. It should be backported, too.
Zane van Iperen April 1, 2021, 1:55 p.m. UTC | #2
On 1/4/21 11:24 pm, James Almer wrote:

> 
> LGTM. It should be backported, too.

That's the plan. Is this just 1/3 or the entire series?
James Almer April 1, 2021, 1:56 p.m. UTC | #3
On 4/1/2021 10:55 AM, Zane van Iperen wrote:
> 
> 
> On 1/4/21 11:24 pm, James Almer wrote:
> 
>>
>> LGTM. It should be backported, too.
> 
> That's the plan. Is this just 1/3 or the entire series?

Just for 1/3.
diff mbox series

Patch

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 78600735cf..58308dae47 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -959,14 +959,14 @@  static const AVOption options[] = {
     { NULL }
 };
 
-static const AVClass adpcm_encoder_class = {
-    .class_name = "ADPCM Encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
 #define ADPCM_ENCODER(id_, name_, sample_fmts_, capabilities_, long_name_) \
+static const AVClass name_ ## _encoder_class = {                           \
+    .class_name = #name_,                                                  \
+    .item_name  = av_default_item_name,                                    \
+    .option     = options,                                                 \
+    .version    = LIBAVUTIL_VERSION_INT,                                   \
+};                                                                         \
+                                                                           \
 AVCodec ff_ ## name_ ## _encoder = {                                       \
     .name           = #name_,                                              \
     .long_name      = NULL_IF_CONFIG_SMALL(long_name_),                    \
@@ -979,7 +979,7 @@  AVCodec ff_ ## name_ ## _encoder = {                                       \
     .sample_fmts    = sample_fmts_,                                        \
     .capabilities   = capabilities_,                                       \
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \
-    .priv_class     = &adpcm_encoder_class,                                \
+    .priv_class     = &name_ ## _encoder_class,                            \
 }
 
 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_ARGO,    adpcm_argo,    sample_fmts_p, 0,                             "ADPCM Argonaut Games");