increment initial_prog_date_time when removing old segments
authorRobert Nagy <ronag89@gmail.com>
Fri, 11 Nov 2016 13:56:00 +0000 (21:56 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Sat, 12 Nov 2016 09:15:28 +0000 (17:15 +0800)
Fixes https://trac.ffmpeg.org/ticket/5940#ticket

Reviewed-by: Michael Niedermayer <<michael@niedermayer.cc>>
Signed-off-by: Robert Nagy <ronag89@gmail.com>
Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
libavformat/hlsenc.c

index 9ca2df7..e16fb0c 100644 (file)
@@ -183,6 +183,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
     segment = hls->old_segments;
     while (segment) {
         playlist_duration -= segment->duration;
+        hls->initial_prog_date_time += segment->duration;
         previous_segment = segment;
         segment = previous_segment->next;
         if (playlist_duration <= -previous_segment->duration) {