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/microdvddec.c | |
parent | 805685fffd3115d3f9260d8df15ef36b6b3b8006 (diff) | |
download | ffmpeg-streaming-29412821241050c846dbceaad4b9752857659977.zip ffmpeg-streaming-29412821241050c846dbceaad4b9752857659977.tar.gz |
lavc: allow subtitle text format to be ASS without timing
Diffstat (limited to 'libavcodec/microdvddec.c')
-rw-r--r-- | libavcodec/microdvddec.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index 46d6d14..e8d2719 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -280,6 +280,7 @@ static int microdvd_decode_frame(AVCodecContext *avctx, AVBPrint new_line; char *line = avpkt->data; char *end = avpkt->data + avpkt->size; + FFASSDecoderContext *s = avctx->priv_data; struct microdvd_tag tags[sizeof(MICRODVD_TAGS) - 1] = {{0}}; if (avpkt->size <= 0) @@ -308,14 +309,7 @@ static int microdvd_decode_frame(AVCodecContext *avctx, } } if (new_line.len) { - int ret; - int64_t start = avpkt->pts; - int64_t duration = avpkt->duration; - int ts_start = av_rescale_q(start, avctx->time_base, (AVRational){1,100}); - int ts_duration = duration != -1 ? - av_rescale_q(duration, avctx->time_base, (AVRational){1,100}) : -1; - - ret = ff_ass_add_rect_bprint(sub, &new_line, ts_start, ts_duration); + int ret = ff_ass_add_rect(sub, new_line.str, s->readorder++, 0, NULL, NULL); av_bprint_finalize(&new_line, NULL); if (ret < 0) return ret; @@ -381,4 +375,6 @@ AVCodec ff_microdvd_decoder = { .id = AV_CODEC_ID_MICRODVD, .init = microdvd_init, .decode = microdvd_decode_frame, + .flush = ff_ass_decoder_flush, + .priv_data_size = sizeof(FFASSDecoderContext), }; |