aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2020-05-29 11:39:05 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-05 13:01:36 +0200
commit6959358683c7533f586c07a766acc5fe9544d8b2 (patch)
treedb6de67e6b85605b6c6a64e54bdadf73f80a9930
parent449bdf05f8843c675e96daa04ecf08f1a013fbd9 (diff)
downloadffmpeg-6959358683c7533f586c07a766acc5fe9544d8b2.tar.gz
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 9dfb19baeb86a8bb02c53a441682c6e9a6e104cc)
-rw-r--r--libavformat/hls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index bccaf67fa1..77d7aeba17 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -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 {
@@ -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;