diff mbox series

[FFmpeg-devel,2/5] lavc/hevcdec: do not call export_stream_params_from_sei() in update_thread_context()

Message ID 20240626124337.14478-2-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/5] lavc/hevcdec: call export_stream_params_from_sei() before ff_get_buffer() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov June 26, 2024, 12:43 p.m. UTC
It is redundant, since it only sets AVCodecContext fields that are
already copied by the generic code.
---
 libavcodec/hevc/hevcdec.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Andreas Rheinhardt June 26, 2024, 4:13 p.m. UTC | #1
Anton Khirnov:
> It is redundant, since it only sets AVCodecContext fields that are
> already copied by the generic code.
> ---
>  libavcodec/hevc/hevcdec.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
> index e80f2f28c7..4a62170073 100644
> --- a/libavcodec/hevc/hevcdec.c
> +++ b/libavcodec/hevc/hevcdec.c
> @@ -3637,10 +3637,6 @@ static int hevc_update_thread_context(AVCodecContext *dst,
>      s->sei.common.content_light        = s0->sei.common.content_light;
>      s->sei.common.aom_film_grain       = s0->sei.common.aom_film_grain;
>  
> -    ret = export_stream_params_from_sei(s);
> -    if (ret < 0)
> -        return ret;
> -
>      return 0;
>  }
>  #endif

Won't this simply reopen ticket #8610 (when only patches 1+2 are applied)?

- Andreas
Anton Khirnov June 26, 2024, 4:23 p.m. UTC | #2
Quoting Andreas Rheinhardt (2024-06-26 18:13:44)
> Anton Khirnov:
> > It is redundant, since it only sets AVCodecContext fields that are
> > already copied by the generic code.
> > ---
> >  libavcodec/hevc/hevcdec.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
> > index e80f2f28c7..4a62170073 100644
> > --- a/libavcodec/hevc/hevcdec.c
> > +++ b/libavcodec/hevc/hevcdec.c
> > @@ -3637,10 +3637,6 @@ static int hevc_update_thread_context(AVCodecContext *dst,
> >      s->sei.common.content_light        = s0->sei.common.content_light;
> >      s->sei.common.aom_film_grain       = s0->sei.common.aom_film_grain;
> >  
> > -    ret = export_stream_params_from_sei(s);
> > -    if (ret < 0)
> > -        return ret;
> > -
> >      return 0;
> >  }
> >  #endif
> 
> Won't this simply reopen ticket #8610 (when only patches 1+2 are applied)?

I did test the sample from that issue and it exports the correct value
with any thread count. TBH I don't quite understand why the call was
added here in the first place, as it never should have been needed.
diff mbox series

Patch

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index e80f2f28c7..4a62170073 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3637,10 +3637,6 @@  static int hevc_update_thread_context(AVCodecContext *dst,
     s->sei.common.content_light        = s0->sei.common.content_light;
     s->sei.common.aom_film_grain       = s0->sei.common.aom_film_grain;
 
-    ret = export_stream_params_from_sei(s);
-    if (ret < 0)
-        return ret;
-
     return 0;
 }
 #endif