0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

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.
This commit is contained in:
Jan Ekström 2023-03-14 23:27:20 +02:00
parent e20b645611
commit 9f5d7d5932

View File

@ -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)