changeset 35030:97470e8b352f

Pass extradata to libavcodec subtitle decoder.
author reimar
date Mon, 27 Aug 2012 20:15:39 +0000
parents 7abba31768ec
children 135b1ef31668
files sub/av_sub.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sub/av_sub.c	Mon Aug 27 19:57:33 2012 +0000
+++ b/sub/av_sub.c	Mon Aug 27 20:15:39 2012 +0000
@@ -27,6 +27,9 @@
 void reset_avsub(struct sh_sub *sh)
 {
     if (sh->context) {
+        AVCodecContext *ctx = sh->context;
+        ctx->extradata = NULL;
+        ctx->extradata_size = 0;
         avcodec_close(sh->context);
         av_freep(&sh->context);
     }
@@ -107,6 +110,8 @@
         AVCodec *sub_codec;
         init_avcodec();
         ctx = avcodec_alloc_context3(NULL);
+        ctx->extradata_size = sh->extradata_len;
+        ctx->extradata = sh->extradata;
         sub_codec = avcodec_find_decoder(cid);
         if (!ctx || !sub_codec || avcodec_open2(ctx, sub_codec, NULL) < 0) {
             mp_msg(MSGT_SUBREADER, MSGL_FATAL,