Commit c3e279e7 authored by Steven Liu's avatar Steven Liu

avformat/hlsenc: fix missing first segment bug in fmp4 mode

fix ticket id: #6776
fix code logic error, need not check first segment.
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent f5208307
...@@ -1080,7 +1080,7 @@ static int hls_window(AVFormatContext *s, int last) ...@@ -1080,7 +1080,7 @@ static int hls_window(AVFormatContext *s, int last)
avio_printf(out, ",BYTERANGE=\"%"PRId64"@%"PRId64"\"", en->size, en->pos); avio_printf(out, ",BYTERANGE=\"%"PRId64"@%"PRId64"\"", en->size, en->pos);
} }
avio_printf(out, "\n"); avio_printf(out, "\n");
} else { }
if (hls->flags & HLS_ROUND_DURATIONS) if (hls->flags & HLS_ROUND_DURATIONS)
avio_printf(out, "#EXTINF:%ld,\n", lrint(en->duration)); avio_printf(out, "#EXTINF:%ld,\n", lrint(en->duration));
else else
...@@ -1088,7 +1088,7 @@ static int hls_window(AVFormatContext *s, int last) ...@@ -1088,7 +1088,7 @@ static int hls_window(AVFormatContext *s, int last)
if (byterange_mode) if (byterange_mode)
avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n",
en->size, en->pos); en->size, en->pos);
}
if (hls->flags & HLS_PROGRAM_DATE_TIME) { if (hls->flags & HLS_PROGRAM_DATE_TIME) {
time_t tt, wrongsecs; time_t tt, wrongsecs;
int milli; int milli;
...@@ -1113,11 +1113,9 @@ static int hls_window(AVFormatContext *s, int last) ...@@ -1113,11 +1113,9 @@ static int hls_window(AVFormatContext *s, int last)
avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, milli, buf1); avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, milli, buf1);
prog_date_time += en->duration; prog_date_time += en->duration;
} }
if (!((hls->segment_type == SEGMENT_TYPE_FMP4) && (en == hls->segments))) {
if (hls->baseurl) if (hls->baseurl)
avio_printf(out, "%s", hls->baseurl); avio_printf(out, "%s", hls->baseurl);
avio_printf(out, "%s\n", en->filename); avio_printf(out, "%s\n", en->filename);
}
} }
if (last && (hls->flags & HLS_OMIT_ENDLIST)==0) if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment