summaryrefslogtreecommitdiff
path: root/libavcodec/jacosubdec.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-01-06 13:43:23 +0100
committerClément Bœsch <u@pkh.me>2016-02-26 21:49:34 +0100
commit29412821241050c846dbceaad4b9752857659977 (patch)
treeeb42444a7a6bf5d2dc66cdec8c7aa26be32bed99 /libavcodec/jacosubdec.c
parent805685fffd3115d3f9260d8df15ef36b6b3b8006 (diff)
downloadffmpeg-29412821241050c846dbceaad4b9752857659977.tar.gz
lavc: allow subtitle text format to be ASS without timing
Diffstat (limited to 'libavcodec/jacosubdec.c')
-rw-r--r--libavcodec/jacosubdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c
index 0c97eb86c0..cdb372af58 100644
--- a/libavcodec/jacosubdec.c
+++ b/libavcodec/jacosubdec.c
@@ -167,6 +167,7 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
int ret;
AVSubtitle *sub = data;
const char *ptr = avpkt->data;
+ FFASSDecoderContext *s = avctx->priv_data;
if (avpkt->size <= 0)
goto end;
@@ -181,7 +182,7 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
av_bprint_init(&buffer, JSS_MAX_LINESIZE, JSS_MAX_LINESIZE);
jacosub_to_ass(avctx, &buffer, ptr);
- ret = ff_ass_add_rect_bprint(sub, &buffer, avpkt->pts, avpkt->duration);
+ ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
av_bprint_finalize(&buffer, NULL);
if (ret < 0)
return ret;
@@ -199,4 +200,6 @@ AVCodec ff_jacosub_decoder = {
.id = AV_CODEC_ID_JACOSUB,
.init = ff_ass_subtitle_header_default,
.decode = jacosub_decode_frame,
+ .flush = ff_ass_decoder_flush,
+ .priv_data_size = sizeof(FFASSDecoderContext),
};