diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-27 15:25:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-27 17:29:18 +0200 |
commit | 07fc47909f6f3a8faa92c2715e07bba6d833074c (patch) | |
tree | 36d96a202e8df52df506029a7448e3480065f7a9 /libavformat | |
parent | f722009ad99733e619273372ade56c4c1b9c3b02 (diff) | |
download | ffmpeg-07fc47909f6f3a8faa92c2715e07bba6d833074c.tar.gz |
avformat/mpsubdec: Use double instead of float for timestamp calculations
This provides higher precission
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpsubdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index c49f149390..7c26d4f42c 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -59,13 +59,13 @@ static int mpsub_read_header(AVFormatContext *s) AVRational pts_info = (AVRational){ 100, 1 }; // ts based by default int res = 0; int multiplier = 100; - float current_pts = 0; + double current_pts = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); while (!avio_feof(s->pb)) { char line[1024]; - float start, duration; + double start, duration; int fps, len = ff_get_line(s->pb, line, sizeof(line)); if (!len) @@ -77,7 +77,7 @@ static int mpsub_read_header(AVFormatContext *s) /* frame based timing */ pts_info = (AVRational){ fps, 1 }; multiplier = 1; - } else if (sscanf(line, "%f %f", &start, &duration) == 2) { + } else if (sscanf(line, "%lf %lf", &start, &duration) == 2) { AVPacket *sub; const int64_t pos = avio_tell(s->pb); |