diff mbox series

[FFmpeg-devel,1/5] avcodec/libsvtav1: Fix redundant setting of caps_internal

Message ID 1631789657-16936-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/5] avcodec/libsvtav1: Fix redundant setting of caps_internal
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Limin Wang Sept. 16, 2021, 10:54 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libsvtav1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andreas Rheinhardt Sept. 16, 2021, 11:32 a.m. UTC | #1
lance.lmwang@gmail.com:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavcodec/libsvtav1.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> index fabc4e6..82ae2b9 100644
> --- a/libavcodec/libsvtav1.c
> +++ b/libavcodec/libsvtav1.c
> @@ -561,12 +561,11 @@ const AVCodec ff_libsvtav1_encoder = {
>      .receive_packet = eb_receive_packet,
>      .close          = eb_enc_close,
>      .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS,
> -    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS,
> +    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP,
>      .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
>                                                      AV_PIX_FMT_YUV420P10,
>                                                      AV_PIX_FMT_NONE },
>      .priv_class     = &class,
>      .defaults       = eb_enc_defaults,
> -    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>      .wrapper_name   = "libsvtav1",
>  };
> 
This is not redundant; the second initialization overrides the first. If
I read validate_thread_parameters in pthread.c correctly, this means
that 7d09579190d broke the ability to forward the threading parameters
to the actual encoder. But it never did this anyway, so it doesn't
matter. Should be fixed nevertheless.

- Andreas
Limin Wang Sept. 16, 2021, 2:09 p.m. UTC | #2
On Thu, Sep 16, 2021 at 01:32:00PM +0200, Andreas Rheinhardt wrote:
> lance.lmwang@gmail.com:
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> >  libavcodec/libsvtav1.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
> > index fabc4e6..82ae2b9 100644
> > --- a/libavcodec/libsvtav1.c
> > +++ b/libavcodec/libsvtav1.c
> > @@ -561,12 +561,11 @@ const AVCodec ff_libsvtav1_encoder = {
> >      .receive_packet = eb_receive_packet,
> >      .close          = eb_enc_close,
> >      .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS,
> > -    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS,
> > +    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP,
> >      .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
> >                                                      AV_PIX_FMT_YUV420P10,
> >                                                      AV_PIX_FMT_NONE },
> >      .priv_class     = &class,
> >      .defaults       = eb_enc_defaults,
> > -    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> >      .wrapper_name   = "libsvtav1",
> >  };
> > 
> This is not redundant; the second initialization overrides the first. If
> I read validate_thread_parameters in pthread.c correctly, this means
> that 7d09579190d broke the ability to forward the threading parameters
> to the actual encoder. But it never did this anyway, so it doesn't
> matter. Should be fixed nevertheless.
Yes, It seems that the commit message is misleading, it's the second overrides the first.
I'll change it to " Fix override setting of caps_internal".

> 
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index fabc4e6..82ae2b9 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -561,12 +561,11 @@  const AVCodec ff_libsvtav1_encoder = {
     .receive_packet = eb_receive_packet,
     .close          = eb_enc_close,
     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS,
-    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS,
+    .caps_internal  = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP,
     .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
                                                     AV_PIX_FMT_YUV420P10,
                                                     AV_PIX_FMT_NONE },
     .priv_class     = &class,
     .defaults       = eb_enc_defaults,
-    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .wrapper_name   = "libsvtav1",
 };