[FFmpeg-cvslog] hlsenc: Don't reset the number variable when wrapping
Carl Eugen Hoyos
git at videolan.org
Fri Aug 16 14:21:36 CEST 2013
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Jun 6 12:09:38 2013 +0200| [9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a] | committer: Martin Storsjö
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 at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a
---
libavformat/hlsenc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a4b1baf..3dd4273 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)
More information about the ffmpeg-cvslog
mailing list