Skip to content
Permalink
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
T-bagwell authored and michaelni committed Jul 5, 2020
1 parent 449bdf0 commit 6959358
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libavformat/hls.c
Expand Up @@ -806,8 +806,6 @@ static int parse_playlist(HLSContext *c, const char *url,
ret = AVERROR(ENOMEM);
goto fail;
}
seg->duration = duration;
seg->key_type = key_type;
if (has_iv) {
memcpy(seg->iv, iv, sizeof(iv));
} else {
Expand Down Expand Up @@ -837,6 +835,11 @@ static int parse_playlist(HLSContext *c, const char *url,
goto fail;
}

if (duration < 0.001 * AV_TIME_BASE) {
duration = 0.001 * AV_TIME_BASE;
}
seg->duration = duration;
seg->key_type = key_type;
dynarray_add(&pls->segments, &pls->n_segments, seg);
is_segment = 0;

Expand Down

0 comments on commit 6959358

Please sign in to comment.