[FFmpeg-trac] #8037(avformat:open): Incorrect HLS segment duration after 64350th frame with -hls_init_time
FFmpeg
trac at avcodec.org
Sun Jul 28 22:10:49 EEST 2019
#8037: Incorrect HLS segment duration after 64350th frame with -hls_init_time
-------------------------------------+-------------------------------------
Reporter: DusanBrejka | Owner: stevenliu
Type: defect | Status: open
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: hls mpegts | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by stevenliu):
the simple test method to check the logic, add an log after the patch:
{{{
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 2ade6723f9..d037fe0a46 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2301,8 +2301,9 @@ 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 - hls->start_sequence -
vs->nb_entries ) * (hls->time * AV_TIME_BASE);
+ int64_t init_list_dur = hls->init_time * vs->nb_entries *
AV_TIME_BASE;
+ int64_t after_init_list_dur = (vs->sequence - hls->start_sequence
- vs->nb_entries ) * (hls->time * AV_TIME_BASE);
+ av_log(s, AV_LOG_ERROR, "Test for blablabla\n");
hls->recording_time = hls->time * AV_TIME_BASE;
end_pts = init_list_dur + after_init_list_dur ;
}
}}}
check it have use the newest libavformat lib.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8037#comment:16>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list