Module: libav
Branch: master
Commit: 9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a

Author:    Carl Eugen Hoyos <[email protected]>
Committer: Martin Storsjö <[email protected]>
Date:      Thu Jun  6 12:09:38 2013 +0200

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ö <[email protected]>

---

 libavformat/hlsenc.c |    6 ++----
 1 files 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)

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to