diff options
author | Clément Bœsch <u@pkh.me> | 2016-01-06 13:43:23 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2016-02-26 21:49:34 +0100 |
commit | 29412821241050c846dbceaad4b9752857659977 (patch) | |
tree | eb42444a7a6bf5d2dc66cdec8c7aa26be32bed99 /libavcodec/subviewerdec.c | |
parent | 805685fffd3115d3f9260d8df15ef36b6b3b8006 (diff) | |
download | ffmpeg-29412821241050c846dbceaad4b9752857659977.tar.gz |
lavc: allow subtitle text format to be ASS without timing
Diffstat (limited to 'libavcodec/subviewerdec.c')
-rw-r--r-- | libavcodec/subviewerdec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index a008828540..805c7dd547 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -52,13 +52,12 @@ static int subviewer_decode_frame(AVCodecContext *avctx, int ret = 0; AVSubtitle *sub = data; const char *ptr = avpkt->data; + FFASSDecoderContext *s = avctx->priv_data; AVBPrint buf; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); - // note: no need to rescale pts & duration since they are in the same - // timebase as ASS (1/100) if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr)) - ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration); + ret = ff_ass_add_rect(sub, buf.str, s->readorder++, 0, NULL, NULL); av_bprint_finalize(&buf, NULL); if (ret < 0) return ret; @@ -73,4 +72,6 @@ AVCodec ff_subviewer_decoder = { .id = AV_CODEC_ID_SUBVIEWER, .decode = subviewer_decode_frame, .init = ff_ass_subtitle_header_default, + .flush = ff_ass_decoder_flush, + .priv_data_size = sizeof(FFASSDecoderContext), }; |