mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-01 22:49:21 +00: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;
|
segment = hls->old_segments;
|
||||||
while (segment) {
|
while (segment) {
|
||||||
playlist_duration -= segment->duration;
|
playlist_duration -= segment->duration;
|
||||||
hls->initial_prog_date_time += segment->duration;
|
|
||||||
previous_segment = segment;
|
previous_segment = segment;
|
||||||
segment = previous_segment->next;
|
segment = previous_segment->next;
|
||||||
if (playlist_duration <= -previous_segment->duration) {
|
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) {
|
if (hls->max_nb_segments && hls->nb_entries >= hls->max_nb_segments) {
|
||||||
en = hls->segments;
|
en = hls->segments;
|
||||||
|
hls->initial_prog_date_time += en->duration;
|
||||||
hls->segments = en->next;
|
hls->segments = en->next;
|
||||||
if (en && hls->flags & HLS_DELETE_SEGMENTS &&
|
if (en && hls->flags & HLS_DELETE_SEGMENTS &&
|
||||||
!(hls->flags & HLS_SINGLE_FILE || hls->wrap)) {
|
!(hls->flags & HLS_SINGLE_FILE || hls->wrap)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user