From 9f5d7d59328bc6d73d06fe67431a3d4ad4ffc2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Tue, 14 Mar 2023 23:27:20 +0200 Subject: [PATCH] sub/sd_lavc: properly fill avctx with codecpar values at init Similar reasons as with the previous commit touching lavc_conv, as well as this being the last location where mp_lavc_set_extradata being utilized. --- sub/sd_lavc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 8bbd7b784b..1f7bf76fce 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -99,7 +99,8 @@ static int init(struct sd *sd) priv->avpkt = av_packet_alloc(); if (!priv->avpkt) goto error; - mp_lavc_set_extradata(ctx, sd->codec->extradata, sd->codec->extradata_size); + if (mp_set_avctx_codec_headers(ctx, sd->codec) < 0) + goto error; priv->pkt_timebase = mp_get_codec_timebase(sd->codec); ctx->pkt_timebase = priv->pkt_timebase; if (avcodec_open2(ctx, sub_codec, NULL) < 0)