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: Martin Storsjö <martin@martin.st>
This commit is contained in:
Carl Eugen Hoyos 2013-06-06 12:09:38 +02:00 committed by Martin Storsjö
parent 09c93b1b95
commit 9d86bfc259

View File

@ -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)
return AVERROR(EINVAL);
c->number++;
if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)