mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
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>
This commit is contained in:
parent
b347ca9341
commit
c7c0046efc
@ -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…
x
Reference in New Issue
Block a user