]> git.sesse.net Git - ffmpeg/commit
avformat/hlsenc: program_date_time and append_list flags conflict
authorBela Bodecs <bodecsb@vivanet.hu>
Sat, 18 Jan 2020 16:41:55 +0000 (17:41 +0100)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 20 Jan 2020 06:34:26 +0000 (14:34 +0800)
commitdd5c7378bb92f174e7b3b36df3d7685ed60f29c6
treecb63285757add770b2625b13e77cda1b54423ad3
parent9faee5bc148fdf4d5340cdcf7e464078972dc72c
avformat/hlsenc: program_date_time and append_list flags conflict

When program_date_time flag is present, in m3u8 playlist file each
segment has a corresponding EXT-X-PROGRAM-DATE-TIME value. The intial
program-date-time value is the actual current time at init and
each new segment increments this value by its duration. When append_list
flags is also present, existing playlist parsing by hls_append_segment
treats existing segments as new segments regarding the program-date-time
calculation. But it should not do that, because this way all real the
new segments' EXT-X-PROGRAM-DATE-TIME values will be shifted erroneously
by the sum duration of existing segments. Instead it should have
decremented the initial program-date-time value by its duration. This
would ensure that
the first new segment's program-date-time value had the current time as
it is expected.
This patch corrects this behaviour and prevent existing segments to
increment the value of initial_prog_date_time variable but decrements
it.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
libavformat/hlsenc.c