Skip to content

Commit 6959358

Browse files
T-bagwellmichaelni
authored andcommitted
avformat/hls: check segment duration value of EXTINF
fix ticket: 8673 set the default EXTINF duration to 1ms if duration is smaller than 1ms Signed-off-by: Steven Liu <lq@chinaffmpeg.org> (cherry picked from commit 9dfb19b)
1 parent 449bdf0 commit 6959358

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: libavformat/hls.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,6 @@ static int parse_playlist(HLSContext *c, const char *url,
806806
ret = AVERROR(ENOMEM);
807807
goto fail;
808808
}
809-
seg->duration = duration;
810-
seg->key_type = key_type;
811809
if (has_iv) {
812810
memcpy(seg->iv, iv, sizeof(iv));
813811
} else {
@@ -837,6 +835,11 @@ static int parse_playlist(HLSContext *c, const char *url,
837835
goto fail;
838836
}
839837

838+
if (duration < 0.001 * AV_TIME_BASE) {
839+
duration = 0.001 * AV_TIME_BASE;
840+
}
841+
seg->duration = duration;
842+
seg->key_type = key_type;
840843
dynarray_add(&pls->segments, &pls->n_segments, seg);
841844
is_segment = 0;
842845

0 commit comments

Comments
 (0)