diff mbox series

[FFmpeg-devel] libvpxdec: Correct linking against variables.

Message ID CAHVN4mgp6Y2YnOZONNHvOdQVxAe4mwSmoyrzrbTDCjB=rNs6tg@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] libvpxdec: Correct linking against variables.
Related show

Checks

Context Check Description
andriy/configurex86 warning Failed to apply patch
andriy/configureppc warning Failed to apply patch

Commit Message

Matt Oliver Nov. 4, 2021, 4:44 a.m. UTC
Instead link against the function that returns the correct variable. This
fixes linking errors with dlls with msvc.
---
 libavcodec/libvpxdec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

                 if (ret)
@@ -350,7 +350,7 @@ static av_cold int vpx_free(AVCodecContext *avctx)
 static av_cold int vp8_init(AVCodecContext *avctx)
 {
     VPxContext *ctx = avctx->priv_data;
-    return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp8_dx_algo);
+    return vpx_init(avctx, &ctx->decoder, vpx_codec_vp8_dx());
 }

 const AVCodec ff_libvpx_vp8_decoder = {
@@ -372,7 +372,7 @@ const AVCodec ff_libvpx_vp8_decoder = {
 static av_cold int vp9_init(AVCodecContext *avctx)
 {
     VPxContext *ctx = avctx->priv_data;
-    return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp9_dx_algo);
+    return vpx_init(avctx, &ctx->decoder, vpx_codec_vp9_dx());
 }

 AVCodec ff_libvpx_vp9_decoder = {
--

Comments

Matt Oliver Nov. 22, 2021, 12:35 p.m. UTC | #1
On Thu, 4 Nov 2021 at 15:44, Matt Oliver <protogonoi@gmail.com> wrote:

> Instead link against the function that returns the correct variable. This
> fixes linking errors with dlls with msvc.
> ---
>  libavcodec/libvpxdec.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
> index 42d1b8ab1c..b2aa205036 100644
> --- a/libavcodec/libvpxdec.c
> +++ b/libavcodec/libvpxdec.c
> @@ -242,11 +242,11 @@ static int vpx_decode(AVCodecContext *avctx,
>                                 &ctx->decoder_alpha,
>  #if CONFIG_LIBVPX_VP8_DECODER && CONFIG_LIBVPX_VP9_DECODER
>                                 (avctx->codec_id == AV_CODEC_ID_VP8) ?
> -                               &vpx_codec_vp8_dx_algo :
> &vpx_codec_vp9_dx_algo
> +                               vpx_codec_vp8_dx() : vpx_codec_vp9_dx()
>  #elif CONFIG_LIBVPX_VP8_DECODER
> -                               &vpx_codec_vp8_dx_algo
> +                               vpx_codec_vp8_dx()
>  #else
> -                               &vpx_codec_vp9_dx_algo
> +                               vpx_codec_vp9_dx()
>  #endif
>                                 );
>                  if (ret)
> @@ -350,7 +350,7 @@ static av_cold int vpx_free(AVCodecContext *avctx)
>  static av_cold int vp8_init(AVCodecContext *avctx)
>  {
>      VPxContext *ctx = avctx->priv_data;
> -    return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp8_dx_algo);
> +    return vpx_init(avctx, &ctx->decoder, vpx_codec_vp8_dx());
>  }
>
>  const AVCodec ff_libvpx_vp8_decoder = {
> @@ -372,7 +372,7 @@ const AVCodec ff_libvpx_vp8_decoder = {
>  static av_cold int vp9_init(AVCodecContext *avctx)
>  {
>      VPxContext *ctx = avctx->priv_data;
> -    return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp9_dx_algo);
> +    return vpx_init(avctx, &ctx->decoder, vpx_codec_vp9_dx());
>  }
>
>  AVCodec ff_libvpx_vp9_decoder = {
> --
>

If no one has any objections I'll push this soon.
I already got an OK from another thread with similar changes to libaom so
I'll assume that this one is good too.
James Zern Nov. 22, 2021, 6:38 p.m. UTC | #2
On Mon, Nov 22, 2021 at 4:35 AM Matt Oliver <protogonoi@gmail.com> wrote:
>
> On Thu, 4 Nov 2021 at 15:44, Matt Oliver <protogonoi@gmail.com> wrote:
>
> > Instead link against the function that returns the correct variable. This
> > fixes linking errors with dlls with msvc.
> > ---
> >  libavcodec/libvpxdec.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >

lgtm. Sorry, I missed this when it came through.
diff mbox series

Patch

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 42d1b8ab1c..b2aa205036 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -242,11 +242,11 @@  static int vpx_decode(AVCodecContext *avctx,
                                &ctx->decoder_alpha,
 #if CONFIG_LIBVPX_VP8_DECODER && CONFIG_LIBVPX_VP9_DECODER
                                (avctx->codec_id == AV_CODEC_ID_VP8) ?
-                               &vpx_codec_vp8_dx_algo :
&vpx_codec_vp9_dx_algo
+                               vpx_codec_vp8_dx() : vpx_codec_vp9_dx()
 #elif CONFIG_LIBVPX_VP8_DECODER
-                               &vpx_codec_vp8_dx_algo
+                               vpx_codec_vp8_dx()
 #else
-                               &vpx_codec_vp9_dx_algo
+                               vpx_codec_vp9_dx()
 #endif
                                );