diff --git a/doc/muxers.texi b/doc/muxers.texi index b6cafaa5fd..b2f4326aae 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -1060,6 +1060,8 @@ and remove the @code{#EXT-X-ENDLIST} from the old segment list. @item round_durations Round the duration info in the playlist file segment info to integer values, instead of using floating point. +If there are no other features requiring higher HLS versions be used, +then this will allow ffmpeg to output a HLS version 2 m3u8. @item discont_start Add the @code{#EXT-X-DISCONTINUITY} tag to the playlist, before the diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 3bafddfa61..7c097b4bf2 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1550,7 +1550,11 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) double *prog_date_time_p = (hls->flags & HLS_PROGRAM_DATE_TIME) ? &prog_date_time : NULL; int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0); - hls->version = 3; + hls->version = 2; + if (!(hls->flags & HLS_ROUND_DURATIONS)) { + hls->version = 3; + } + if (byterange_mode) { hls->version = 4; sequence = 0;