Browse Source

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>
tags/n3.3
Jesper Ek 8 years ago
parent
commit
c7c0046efc
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/hlsenc.c

+ 1
- 1
libavformat/hlsenc.c View File

@@ -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)) {


Loading…
Cancel
Save