From 9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Thu, 6 Jun 2013 12:09:38 +0200 Subject: hlsenc: Don't reset the number variable when wrapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ö --- libavformat/hlsenc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libavformat/hlsenc.c') diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index a4b1baf180..3dd4273eda 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -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) -- cgit v1.2.3