diff options
author | Andrey Semashev <andrey.semashev@gmail.com> | 2018-11-20 20:33:52 +0300 |
---|---|---|
committer | Karthick J <kjeyapal@akamai.com> | 2018-11-23 14:15:32 +0530 |
commit | fa08345e882c7b717744419914c6621ef66d0f5b (patch) | |
tree | d960eaee952076e63e15a1409acb491131f7be83 | |
parent | e895b800fe273d3445be52a4880ae0172c193bc0 (diff) |
lavf/dashenc: Fix segment duration overflow on fine time bases.
When stream time bases are very fine grained (e.g. nanoseconds), 32-bit
segment duration may overflow for even for rather small segment duration
(about 4 seconds long). Therefore we use 64-bit values for segment duration.
-rw-r--r-- | libavformat/dashenc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index e51ffaf31b..6ce70e0076 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -60,7 +60,7 @@ typedef struct Segment { int64_t start_pos; int range_length, index_length; int64_t time; - int duration; + int64_t duration; int n; } Segment; @@ -475,7 +475,7 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, AVFormatCont cur_time = seg->time; avio_printf(out, "t=\"%"PRId64"\" ", seg->time); } - avio_printf(out, "d=\"%d\" ", seg->duration); + avio_printf(out, "d=\"%"PRId64"\" ", seg->duration); while (i + repeat + 1 < os->nb_segments && os->segments[i + repeat + 1]->duration == seg->duration && os->segments[i + repeat + 1]->time == os->segments[i + repeat]->time + os->segments[i + repeat]->duration) @@ -1213,7 +1213,7 @@ static int dash_write_header(AVFormatContext *s) } static int add_segment(OutputStream *os, const char *file, - int64_t time, int duration, + int64_t time, int64_t duration, int64_t start_pos, int64_t range_length, int64_t index_length, int next_exp_index) { |