MT#55283 Fix build with libavcodec older than 61.19

The fallback for `avcodec_get_supported_config()` reads
`dec->avc.codec->pix_fmts`, but the decoder struct has no `codec` member,
so the build fails on anything below libavcodec 61.19:

    lib/avc.c:73:39: error: 'struct <anonymous>' has no member named 'codec'

The line above it uses the `codec` argument and so should this one. The
encoder path has a `codec` member of its own, which is where this looks to
have come from.

Closes #2169

Change-Id: Iebf130d19c5107a012c61b821460a5879a777d39
pull/2166/head
dnygate 3 months ago committed by Richard Fuchs
parent 0986dd191c
commit 55fe3c2847

@ -70,7 +70,7 @@ const char *avc_decoder_init(decoder_t *dec, const str *extra_opts) {
avcodec_get_supported_config(dec->avc.avcctx, codec, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void **) &dec->avc.pixel_fmts, NULL);
#else
dec->avc.sample_fmts = codec->sample_fmts;
dec->avc.pixel_fmts = dec->avc.codec->pix_fmts;
dec->avc.pixel_fmts = codec->pix_fmts;
#endif
for (const enum AVSampleFormat *sfmt = dec->avc.sample_fmts; sfmt && *sfmt != -1; sfmt++)

Loading…
Cancel
Save