hls: Sync the file number with the start sequence
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 29 Apr 2014 16:20:17 +0000 (18:20 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 30 Apr 2014 15:52:49 +0000 (17:52 +0200)
libavformat/hlsenc.c

index 79820f0..d36d3fb 100644 (file)
@@ -173,7 +173,7 @@ static int hls_start(AVFormatContext *s)
     int err = 0;
 
     if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-                              c->basename, c->wrap ? c->number % c->wrap : c->number) < 0)
+                              c->basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0)
         return AVERROR(EINVAL);
     c->number++;
 
@@ -195,9 +195,6 @@ static int hls_write_header(AVFormatContext *s)
     const char *pattern = "%d.ts";
     int basename_size = strlen(s->filename) + strlen(pattern) + 1;
 
-    hls->number      = 0;
-
-
     hls->sequence       = hls->start_sequence;
     hls->recording_time = hls->time * AV_TIME_BASE;
     hls->start_pts      = AV_NOPTS_VALUE;