Commit 9d86bfc2 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos Committed by Martin Storsjö
Browse files

hlsenc: Don't reset the number variable when wrapping

The counter itself shouldn't be wrapped, since it is used for
determining end_pts for the next segment - only wrap the number
used for the segment file name.
Signed-off-by: default avatarMartin Storsjö <>
parent 09c93b1b
......@@ -164,12 +164,10 @@ static int hls_start(AVFormatContext *s)
AVFormatContext *oc = c->avf;
int err = 0;
if (c->wrap)
c->number %= c->wrap;
if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
c->basename, c->number++) < 0)
c->basename, c->wrap ? c->number % c->wrap : c->number) < 0)
if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 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