Message ID | 20181120173352.11499-1-andrey.semashev@gmail.com |
---|---|
State | Accepted |
Commit | fa08345e882c7b717744419914c6621ef66d0f5b |
Headers | show |
On 11/20/18 11:03 PM, Andrey Semashev wrote: > 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. > --- > libavformat/dashenc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c > index d151921175..8d0bc4baa2 100644 > --- a/libavformat/dashenc.c > +++ b/libavformat/dashenc.c > @@ -59,7 +59,7 @@ typedef struct Segment { > int64_t start_pos; > int range_length, index_length; > int64_t time; > - int duration; > + int64_t duration; > int n; > } Segment; > > @@ -428,7 +428,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) > @@ -1149,7 +1149,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) > { LGTM. Thanks and regards, Karthick
2018-11-22 7:43 GMT+01:00, Jeyapal, Karthick <kjeyapal@akamai.com>: > > On 11/20/18 11:03 PM, Andrey Semashev wrote: >> 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. >> --- >> libavformat/dashenc.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c >> index d151921175..8d0bc4baa2 100644 >> --- a/libavformat/dashenc.c >> +++ b/libavformat/dashenc.c >> @@ -59,7 +59,7 @@ typedef struct Segment { >> int64_t start_pos; >> int range_length, index_length; >> int64_t time; >> - int duration; >> + int64_t duration; >> int n; >> } Segment; >> >> @@ -428,7 +428,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) >> @@ -1149,7 +1149,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) >> { > > LGTM. Please commit the patch if it is ok. Carl Eugen
On 11/22/18 6:35 PM, Carl Eugen Hoyos wrote: > 2018-11-22 7:43 GMT+01:00, Jeyapal, Karthick <kjeyapal@akamai.com>: >> >> On 11/20/18 11:03 PM, Andrey Semashev wrote: >>> 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. >>> --- >>> libavformat/dashenc.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c >>> index d151921175..8d0bc4baa2 100644 >>> --- a/libavformat/dashenc.c >>> +++ b/libavformat/dashenc.c >>> @@ -59,7 +59,7 @@ typedef struct Segment { >>> int64_t start_pos; >>> int range_length, index_length; >>> int64_t time; >>> - int duration; >>> + int64_t duration; >>> int n; >>> } Segment; >>> >>> @@ -428,7 +428,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) >>> @@ -1149,7 +1149,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) >>> { >> >> LGTM. > > Please commit the patch if it is ok. Sure. I am just waiting for 3 days to complete as per the ffmpeg developer guidelines. Will push it tomorrow. Let me know if it is urgent for some reason, in which case I will push it earlier. > > Carl Eugen > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
On 11/22/18 7:33 PM, Jeyapal, Karthick wrote: > > On 11/22/18 6:35 PM, Carl Eugen Hoyos wrote: >> 2018-11-22 7:43 GMT+01:00, Jeyapal, Karthick <kjeyapal@akamai.com>: >>> >>> On 11/20/18 11:03 PM, Andrey Semashev wrote: >>>> 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. >>>> --- >>>> libavformat/dashenc.c | 6 +++--- >>>> 1 file changed, 3 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c >>>> index d151921175..8d0bc4baa2 100644 >>>> --- a/libavformat/dashenc.c >>>> +++ b/libavformat/dashenc.c >>>> @@ -59,7 +59,7 @@ typedef struct Segment { >>>> int64_t start_pos; >>>> int range_length, index_length; >>>> int64_t time; >>>> - int duration; >>>> + int64_t duration; >>>> int n; >>>> } Segment; >>>> >>>> @@ -428,7 +428,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) >>>> @@ -1149,7 +1149,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) >>>> { >>> >>> LGTM. >> >> Please commit the patch if it is ok. > Sure. I am just waiting for 3 days to complete as per the ffmpeg developer guidelines. > Will push it tomorrow. Let me know if it is urgent for some reason, in which case I will push it earlier. Pushed. >> >> Carl Eugen >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index d151921175..8d0bc4baa2 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -59,7 +59,7 @@ typedef struct Segment { int64_t start_pos; int range_length, index_length; int64_t time; - int duration; + int64_t duration; int n; } Segment; @@ -428,7 +428,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) @@ -1149,7 +1149,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) {