[FFmpeg-cvslog] lavf/segment: fix value for the M3U8 EXT-X-MEDIA

Stefano Sabatini git at videolan.org
Tue Nov 20 22:56:36 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sat Nov 17 17:21:43 2012 +0100| [8b6aeb1fcdd975422e251ebfc3da8565d7f6c604] | committer: Stefano Sabatini

lavf/segment: fix value for the M3U8 EXT-X-MEDIA

>From the M3U8 specification:
|The EXT-X-MEDIA-SEQUENCE tag indicates the sequence number of the first
|URI that appears in a Playlist file.

Previously it was using the list index number. Also remove now unused
list_count field.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b6aeb1fcdd975422e251ebfc3da8565d7f6c604
---

 libavformat/segment.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index c494bbf..1ad410e 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -58,7 +58,6 @@ typedef struct {
     AVFormatContext *avf;
     char *format;          ///< format to use for output segment files
     char *list;            ///< filename for the segment list file
-    int   list_count;      ///< list counter
     int   list_flags;      ///< flags affecting list generation
     int   list_size;       ///< number of entries for the segment list file
     double list_max_segment_time; ///< max segment time in the current list
@@ -182,7 +181,7 @@ static int segment_list_open(AVFormatContext *s)
     if (seg->list_type == LIST_TYPE_M3U8) {
         avio_printf(seg->list_pb, "#EXTM3U\n");
         avio_printf(seg->list_pb, "#EXT-X-VERSION:3\n");
-        avio_printf(seg->list_pb, "#EXT-X-MEDIA-SEQUENCE:%d\n", seg->list_count);
+        avio_printf(seg->list_pb, "#EXT-X-MEDIA-SEQUENCE:%d\n", seg->segment_idx);
         avio_printf(seg->list_pb, "#EXT-X-ALLOWCACHE:%d\n",
                     !!(seg->list_flags & SEGMENT_LIST_FLAG_CACHE));
         if (seg->list_flags & SEGMENT_LIST_FLAG_LIVE)
@@ -203,7 +202,6 @@ static void segment_list_close(AVFormatContext *s)
                         (int)ceil(seg->list_max_segment_time));
         avio_printf(seg->list_pb, "#EXT-X-ENDLIST\n");
     }
-    seg->list_count++;
 
     avio_close(seg->list_pb);
 }



More information about the ffmpeg-cvslog mailing list