[FFmpeg-cvslog] avformat/avidec: Forward whitelists to the subtitle demuxer

Michael Niedermayer git at videolan.org
Thu Oct 23 18:38:34 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 23 16:07:31 2014 +0200| [b76234c00c7cac154dac50f4993e4372e47e3718] | committer: Michael Niedermayer

avformat/avidec: Forward whitelists to the subtitle demuxer

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b76234c00c7cac154dac50f4993e4372e47e3718
---

 libavformat/avidec.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index fa6821c..e4f43a2 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -996,7 +996,7 @@ fail:
     return 0;
 }
 
-static int read_gab2_sub(AVStream *st, AVPacket *pkt)
+static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
 {
     if (pkt->size >= 7 &&
         pkt->size < INT_MAX - AVPROBE_PADDING_SIZE &&
@@ -1039,6 +1039,11 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt)
             goto error;
 
         ast->sub_ctx->pb = pb;
+
+        av_assert0(!ast->sub_ctx->codec_whitelist && !ast->sub_ctx->format_whitelist);
+        ast->sub_ctx-> codec_whitelist = av_strdup(s->codec_whitelist);
+        ast->sub_ctx->format_whitelist = av_strdup(s->format_whitelist);
+
         if (!avformat_open_input(&ast->sub_ctx, "", sub_demuxer, NULL)) {
             ff_read_packet(ast->sub_ctx, &ast->sub_pkt);
             *st->codec = *ast->sub_ctx->streams[0]->codec;
@@ -1390,7 +1395,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
             if (size < 0)
                 av_free_packet(pkt);
         } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE &&
-                   !st->codec->codec_tag && read_gab2_sub(st, pkt)) {
+                   !st->codec->codec_tag && read_gab2_sub(s, st, pkt)) {
             ast->frame_offset++;
             avi->stream_index = -1;
             ast->remaining    = 0;



More information about the ffmpeg-cvslog mailing list