diff options
author | Jesper Ek <deadbeef84@gmail.com> | 2016-12-27 10:10:44 +0800 |
---|---|---|
committer | Jesper Ek <deadbeef84@gmail.com> | 2016-12-27 10:10:44 +0800 |
commit | c7c0046efc3a05e52d0a6da4da9f0beae47c0847 (patch) | |
tree | 7429acb08da9097446e54a857d3182f85cfc753b | |
parent | b347ca93412f43fb4593e1381b3b22e2fa20c0de (diff) | |
download | ffmpeg-c7c0046efc3a05e52d0a6da4da9f0beae47c0847.tar.gz |
Fix bug when incrementing initial_prog_date_time when removing segments
initial_prog_date_time shouldn't be adjusted when deleting segments
from disk, but rather when segments are removed from the playlist.
Signed-off-by: Jesper Ek <deadbeef84@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r-- | libavformat/hlsenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e46e9b4270..648e775dfa 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -185,7 +185,6 @@ 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) { @@ -414,6 +413,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double if (hls->max_nb_segments && hls->nb_entries >= hls->max_nb_segments) { en = hls->segments; + hls->initial_prog_date_time += en->duration; hls->segments = en->next; if (en && hls->flags & HLS_DELETE_SEGMENTS && !(hls->flags & HLS_SINGLE_FILE || hls->wrap)) { |