summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-11 01:28:18 +0100
committerwm4 <wm4@nowhere>2014-01-11 01:28:18 +0100
commit14bd02a034f1361485b72dff3e3247b300700954 (patch)
tree12ab7bed39297e6418d777163af6271d3d2ff016 /sub
parent4b4926bbb3102836fc0c2edafe791cca6209f45e (diff)
downloadmpv-14bd02a034f1361485b72dff3e3247b300700954.tar.bz2
mpv-14bd02a034f1361485b72dff3e3247b300700954.tar.xz
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.
Diffstat (limited to 'sub')
-rw-r--r--sub/sd_lavc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index dda6ac4f1c..7fa798dd66 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -102,8 +102,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;
@@ -259,6 +258,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);
}