sd_lavc: use mp_lavc_set_extradata()

This includes the magical input padding required by libavcodec, which we
possibly didn't do before this commit.
This commit is contained in:
wm4 committed 2014-03-11 00:07:57 +01:00
1 parent 5ab2aa84e0
commit 842689bbf6
1 file changed
+2 -2
+2 -2
View File
@@ -103,8 +103,7 @@ static int init(struct sd *sd)
ctx = avcodec_alloc_context3(sub_codec);
if (!ctx)
goto error;
ctx->extradata_size = sd->extradata_len;
ctx->extradata = sd->extradata;
mp_lavc_set_extradata(ctx, sd->extradata, sd->extradata_len);
if (avcodec_open2(ctx, sub_codec, NULL) < 0)
goto error;
priv->avctx = ctx;
@@ -264,6 +263,7 @@ static void uninit(struct sd *sd)
clear(priv);
avcodec_close(priv->avctx);
av_free(priv->avctx->extradata);
av_free(priv->avctx);
talloc_free(priv);
}