summaryrefslogtreecommitdiff
path: root/libavcodec/ccaption_dec.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2016-01-05 22:55:18 -0800
committerClément Bœsch <u@pkh.me>2016-01-09 11:53:56 +0100
commit8fd7f03c56f78decf5ee2a9283338794a1f4c4b9 (patch)
tree58b2669e95ea11d961696b618cb18596bb6f266a /libavcodec/ccaption_dec.c
parent6049b15c0afce3e4c359f9ca194c04980064b0dd (diff)
lavc/ccaption_dec: extract ass time base into constant
Diffstat (limited to 'libavcodec/ccaption_dec.c')
-rw-r--r--libavcodec/ccaption_dec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 58bea47c98..bbbd2d821c 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -30,6 +30,8 @@
#define UNSET_FLAG(var, val) ( (var) &= ~( 1 << (val)) )
#define CHECK_FLAG(var, val) ( (var) & ( 1 << (val)) )
+static const AVRational ass_tb = {1, 100};
+
/*
* TODO list
* 1) handle font and color completely
@@ -512,8 +514,8 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
process_cc608(ctx, avpkt->pts, *(bptr + i + 1) & 0x7f, *(bptr + i + 2) & 0x7f);
if (ctx->screen_changed && *ctx->buffer.str)
{
- int start_time = av_rescale_q(ctx->start_time, avctx->time_base, (AVRational){ 1, 100 });
- int end_time = av_rescale_q(ctx->end_time, avctx->time_base, (AVRational){ 1, 100 });
+ int start_time = av_rescale_q(ctx->start_time, avctx->time_base, ass_tb);
+ int end_time = av_rescale_q(ctx->end_time, avctx->time_base, ass_tb);
ff_dlog(ctx, "cdp writing data (%s)\n",ctx->buffer.str);
ret = ff_ass_add_rect_bprint(sub, &ctx->buffer, start_time, end_time - start_time);
if (ret < 0)