summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-06 12:09:38 +0200
committerMartin Storsjö <martin@martin.st>2013-08-15 22:41:19 +0300
commit9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a (patch)
treeedf02c3359340feaa81a854c0d13d4de045a753c /libavformat/hlsenc.c
parent09c93b1b957f2049ea5fd8fb0e6f4d82680172f2 (diff)
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>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c6
1 files changed, 2 insertions, 4 deletions
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)