1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-15 04:38:48 +02:00

avformat/hlsenc: check discont_program_date_time before use it in parse_playlist

Fix ticket: 9238
In parse_playlist, the discont_program_date_time should be used after
EXT-X-PROGRAM-DATE-TIME tag parsed.

Tested-by: pero
Reviewed-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2022-05-08 09:15:40 +08:00
parent 439ca8b5f4
commit ea6ed838c3

View File

@ -1286,8 +1286,10 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs
new_start_pos = avio_tell(vs->avf->pb);
vs->size = new_start_pos - vs->start_pos;
ret = hls_append_segment(s, hls, vs, vs->duration, vs->start_pos, vs->size);
vs->last_segment->discont_program_date_time = discont_program_date_time;
discont_program_date_time += vs->duration;
if (discont_program_date_time) {
vs->last_segment->discont_program_date_time = discont_program_date_time;
discont_program_date_time += vs->duration;
}
if (ret < 0)
goto fail;
vs->start_pos = new_start_pos;