aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ass.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-05-26 22:36:31 +0200
committerClément Bœsch <ubitux@gmail.com>2012-05-29 21:33:28 +0200
commitd51e08bb89f7a93f471bc14ad00c14ac986cfcf0 (patch)
tree8675f875aad6e370b73ef62e0abcb02bd5d989d9 /libavcodec/ass.c
parente7cb161515fc9fb6d30d1681d64d9ba7ad737a4e (diff)
downloadffmpeg-d51e08bb89f7a93f471bc14ad00c14ac986cfcf0.tar.gz
lavc: switch from ts_end to duration in ff_ass_add_rect.
Make possible a end-to-presentation duration.
Diffstat (limited to 'libavcodec/ass.c')
-rw-r--r--libavcodec/ass.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index 8c94d724eb..4fe593ee8b 100644
--- a/libavcodec/ass.c
+++ b/libavcodec/ass.c
@@ -70,15 +70,18 @@ static int ts_to_string(char *str, int strlen, int ts)
}
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
- int ts_start, int ts_end, int raw)
+ int ts_start, int duration, int raw)
{
- int len = 0, dlen, duration = ts_end - ts_start;
+ int len = 0, dlen;
char s_start[16], s_end[16], header[48] = {0};
AVSubtitleRect **rects;
if (!raw) {
ts_to_string(s_start, sizeof(s_start), ts_start);
- ts_to_string(s_end, sizeof(s_end), ts_end );
+ if (duration == -1)
+ snprintf(s_end, sizeof(s_end), "9:59:59.99");
+ else
+ ts_to_string(s_end, sizeof(s_end), ts_start + duration);
len = snprintf(header, sizeof(header), "Dialogue: 0,%s,%s,",
s_start, s_end);
}