Re: [FFmpeg-devel] [PATCH 2/2] lavc/srtdec: fix rounding errors in end times

2016-02-21 Thread Clément Bœsch
On Mon, Jan 11, 2016 at 03:58:18AM -0600, Rodger Combs wrote:
> ---
>  libavcodec/srtdec.c  |  4 +++
>  tests/ref/fate/sub-textenc   | 66 
> ++--
>  tests/ref/fate/sub-webvttenc | 66 
> ++--
>  3 files changed, 70 insertions(+), 66 deletions(-)
> 

This issue is also fixed by
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-February/189830.html

[...]

-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] lavc/srtdec: fix rounding errors in end times

2016-01-11 Thread Rodger Combs
---
 libavcodec/srtdec.c  |  4 +++
 tests/ref/fate/sub-textenc   | 66 ++--
 tests/ref/fate/sub-webvttenc | 66 ++--
 3 files changed, 70 insertions(+), 66 deletions(-)

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index 542dd35..285ca7b 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -81,6 +81,10 @@ static int srt_decode_frame(AVCodecContext *avctx,
 avctx->time_base,
 (AVRational){1,100});
 
+sub->end_display_time = av_rescale_q(avpkt->duration,
+ avctx->pkt_timebase,
+ (AVRational){1,1000});
+
 srt_to_ass(avctx, , avpkt->data, x1, y1, x2, y2);
 ret = ff_ass_add_rect_bprint(sub, , ts_start, ts_end-ts_start);
 av_bprint_finalize(, NULL);
diff --git a/tests/ref/fate/sub-textenc b/tests/ref/fate/sub-textenc
index cb0db7f..f7d82ce 100644
--- a/tests/ref/fate/sub-textenc
+++ b/tests/ref/fate/sub-textenc
@@ -16,13 +16,13 @@ If you see this with the normal font, the player don't 
(fully) support font face
 Hidden
 
 4
-00:00:04,501 --> 00:00:07,501
+00:00:04,501 --> 00:00:07,500
 This text should be small
 This text should be normal
 This text should be big
 
 5
-00:00:07,501 --> 00:00:11,501
+00:00:07,501 --> 00:00:11,500
 This should be an E with an accent: È
 日本語
 This text should be bold, italics and underline
@@ -31,7 +31,7 @@ This text should be small and red
 This text should be big and brown
 
 6
-00:00:11,501 --> 00:00:14,501
+00:00:11,501 --> 00:00:14,500
 This line should be bold
 This line should be italics
 This line should be underline
@@ -40,7 +40,7 @@ Both lines
 should be underline
 
 7
-00:00:14,501 --> 00:00:17,501
+00:00:14,501 --> 00:00:17,500
 >
 It would be a good thing to
 hide invalid html tags that are closed and show the text in them
@@ -49,7 +49,7 @@ Show not opened tags
 <
 
 8
-00:00:17,501 --> 00:00:20,501
+00:00:17,501 --> 00:00:20,500
 and also
 hide invalid html tags with parameters that are closed and show the text in 
them
 but show un-closed invalid html tags
@@ -57,66 +57,66 @@ This text should be showed underlined without problems 
also: 2<3,5>1,4<6
 This shouldn't be underlined
 
 9
-00:00:20,501 --> 00:00:21,501
+00:00:20,501 --> 00:00:21,500
 This text should be in the normal position...
 
 10
-00:00:21,501 --> 00:00:22,501
+00:00:21,501 --> 00:00:22,500
 This text should NOT be in the normal position
 
 11
-00:00:22,501 --> 00:00:24,501
+00:00:22,501 --> 00:00:24,500
 Implementation is the same of the ASS tag
 This text should be at the
 top and horizontally centered
 
 12
-00:00:22,501 --> 00:00:24,501
+00:00:22,501 --> 00:00:24,500
 This text should be at the
 middle and horizontally centered
 
 13
-00:00:22,501 --> 00:00:24,501
+00:00:22,501 --> 00:00:24,500
 This text should be at the
 bottom and horizontally centered
 
 14
-00:00:24,501 --> 00:00:26,501
+00:00:24,501 --> 00:00:26,500
 This text should be at the
 top and horizontally at the left
 
 15
-00:00:24,501 --> 00:00:26,501
+00:00:24,501 --> 00:00:26,500
 This text should be at the
 middle and horizontally at the left
 (The second position must be ignored)
 
 16
-00:00:24,501 --> 00:00:26,501
+00:00:24,501 --> 00:00:26,500
 This text should be at the
 bottom and horizontally at the left
 
 17
-00:00:26,501 --> 00:00:28,501
+00:00:26,501 --> 00:00:28,500
 This text should be at the
 top and horizontally at the right
 
 18
-00:00:26,501 --> 00:00:28,501
+00:00:26,501 --> 00:00:28,500
 This text should be at the
 middle and horizontally at the right
 
 19
-00:00:26,501 --> 00:00:28,501
+00:00:26,501 --> 00:00:28,500
 This text should be at the
 bottom and horizontally at the right
 
 20
-00:00:28,501 --> 00:00:31,501
+00:00:28,501 --> 00:00:31,500
 This could be the most difficult thing to implement
 
 21
-00:00:31,501 --> 00:00:50,501
+00:00:31,501 --> 00:00:50,500
 First text
 
 22
@@ -124,38 +124,38 @@ First text
 Second, it shouldn't overlap first
 
 23
-00:00:35,501 --> 00:00:37,501
+00:00:35,501 --> 00:00:37,500
 Third, it should replace second
 
 24
-00:00:36,501 --> 00:00:50,501
+00:00:36,501 --> 00:00:50,500
 Fourth, it shouldn't overlap first and third
 
 25
-00:00:40,501 --> 00:00:45,501
+00:00:40,501 --> 00:00:45,500
 Fifth, it should replace third
 
 26
-00:00:45,501 --> 00:00:50,501
+00:00:45,501 --> 00:00:50,500
 Sixth, it shouldn't be
 showed overlapped
 
 27
-00:00:50,501 --> 00:00:52,501
+00:00:50,501 --> 00:00:52,500
 TEXT 1 (bottom)
 
 28
-00:00:50,501 --> 00:00:52,501
+00:00:50,501 --> 00:00:52,500
 text 2
 
 29
-00:00:52,501 --> 00:00:54,501
+00:00:52,501 --> 00:00:54,500
 Hide these tags:
 also hide these tags:
 but show this: {normal text}
 
 30
-00:00:54,501 --> 00:01:00,501
+00:00:54,501 --> 00:01:00,500
 
 \ N is a forced line break
 \ h is a hard space
@@ -163,21 +163,21 @@ Normal spaces at the start and at the end of the