summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2018-07-09 17:05:30 +0800
committerSteven Liu <lq@chinaffmpeg.org>2018-07-11 13:28:14 +0800
commitbd8a5c6b7ce71c739ab95f6b17e8caeeec2dc9e7 (patch)
tree70a9e6f766a211415362c4be9c572c0e38bc1a4d
parent0bd48ab2d9e463b75ef52c0eaa0cc00c4c385cce (diff)
avformat/hlsenc: improve compute after_init_list_dur
fix ticket: 7305 vs->sequence - hls->start_sequence - vs->nb_entries is the after_init_list_dur fragment numbers fix the wrong compute way vs->sequence - vs->nb_entries Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r--libavformat/hlsenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 2268f898b0..b5644f05c4 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2178,7 +2178,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
if (vs->sequence - vs->nb_entries > hls->start_sequence && hls->init_time > 0) {
/* reset end_pts, hls->recording_time at end of the init hls list */
int init_list_dur = hls->init_time * vs->nb_entries * AV_TIME_BASE;
- int after_init_list_dur = (vs->sequence - vs->nb_entries ) * hls->time * AV_TIME_BASE;
+ int after_init_list_dur = (vs->sequence - hls->start_sequence - vs->nb_entries ) * (hls->time * AV_TIME_BASE);
hls->recording_time = hls->time * AV_TIME_BASE;
end_pts = init_list_dur + after_init_list_dur ;
}