[FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

Steven Liu lingjiujianke at gmail.com
Fri Sep 1 14:00:20 EEST 2017


2017-09-01 18:54 GMT+08:00 Jeyapal, Karthick <kjeyapal at akamai.com>:
>>2017-09-01 18:32 GMT+08:00 Steven Liu <lingjiujianke at gmail.com<mailto:lingjiujianke at gmail.com>>:
>>Sorry, my mistake.
>>
>>the target_duration must large or equal to the en->duration, can not
>>small than en->duration from HLS version 3.
>
> When “round_durations” is enabled “en->duration” also gets rounded(lrint). So in the playlist, the target duration will never be lesser than any of the segment durations. It will still be in compliance to the HLS spec.
> Otherwise we see an output where all segment durations are ‘n’ seconds, and the target duration is ‘n+1’ seconds when round_durations is enabled. This behavior causes some players to misbehave and add more latency unnecessarily.

The hls_time is set to the segments duration, not target duration, and
the hls_time just a reference value, so the target duration is +1.
anyway, this patch can not catch the point.

The spec clearly says it has to be greater or equal. So rounding it up
is perfectly legal and might even safeguard against some poor player
implementations.

>
> Thanks,
> Karthick
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list