diff options
author | Marton Balint <cus@passwd.hu> | 2013-10-23 20:55:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-27 23:12:41 +0100 |
commit | dbe6f9f2c2330e7c230ddd61af1cc2069af1cf04 (patch) | |
tree | 914cb81b534725368160c8994b9f11f733526435 /libavcodec/utils.c | |
parent | b387a24cb4ad14f567ae2643a7959fe61b82f95a (diff) | |
download | ffmpeg-dbe6f9f2c2330e7c230ddd61af1cc2069af1cf04.tar.gz |
lavc: add support for CODEC_CAP_DELAY in subtitles
This patch adds CODEC_CAP_DELAY support to avcodec_decode_subtitle2.
For DVB teletext decoding, a single teletext packet can contain multiple
teletext pages. In order to support that, the teletext decoder may buffer
some pages.
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c1625a216b..186993dc02 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2322,7 +2322,7 @@ static int recode_subtitle(AVCodecContext *avctx, AVPacket tmp; #endif - if (avctx->sub_charenc_mode != FF_SUB_CHARENC_MODE_PRE_DECODER) + if (avctx->sub_charenc_mode != FF_SUB_CHARENC_MODE_PRE_DECODER || inpkt->size == 0) return 0; #if CONFIG_ICONV @@ -2407,7 +2407,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, *got_sub_ptr = 0; avcodec_get_subtitle_defaults(sub); - if (avpkt->size) { + if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) { AVPacket pkt_recoded; AVPacket tmp = *avpkt; int did_split = av_packet_split_side_data(&tmp); |