avformat/avidec: Forward whitelists to the subtitle demuxer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-10-23 16:07:31 +02:00
parent ad83cfec5a
commit b76234c00c

View File

@ -996,7 +996,7 @@ fail:
return 0; 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 && if (pkt->size >= 7 &&
pkt->size < INT_MAX - AVPROBE_PADDING_SIZE && pkt->size < INT_MAX - AVPROBE_PADDING_SIZE &&
@ -1039,6 +1039,11 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt)
goto error; goto error;
ast->sub_ctx->pb = pb; 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)) { if (!avformat_open_input(&ast->sub_ctx, "", sub_demuxer, NULL)) {
ff_read_packet(ast->sub_ctx, &ast->sub_pkt); ff_read_packet(ast->sub_ctx, &ast->sub_pkt);
*st->codec = *ast->sub_ctx->streams[0]->codec; *st->codec = *ast->sub_ctx->streams[0]->codec;
@ -1390,7 +1395,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (size < 0) if (size < 0)
av_free_packet(pkt); av_free_packet(pkt);
} else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE && } 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++; ast->frame_offset++;
avi->stream_index = -1; avi->stream_index = -1;
ast->remaining = 0; ast->remaining = 0;