Ticket #1642: 0007-lavf-segment-add-EXT-X-MEDIA-SEQUENCE-tag-in-M3U8-he.patch

File 0007-lavf-segment-add-EXT-X-MEDIA-SEQUENCE-tag-in-M3U8-he.patch, 1.5 KB (added by saste, 4 years ago)
  • libavformat/segment.c

    From fbd86db013dea9c60cbcf7da272c649ddcaf7e6e Mon Sep 17 00:00:00 2001
    From: Stefano Sabatini <stefasab@gmail.com>
    Date: Sat, 1 Sep 2012 17:59:20 +0200
    Subject: [PATCH] lavf/segment: add EXT-X-MEDIA-SEQUENCE tag in M3U8 header
    
    ---
     libavformat/segment.c |    3 +++
     1 files changed, 3 insertions(+), 0 deletions(-)
    
    diff --git a/libavformat/segment.c b/libavformat/segment.c
    index b53afa9..c695761 100644
    a b typedef struct { 
    5454    AVFormatContext *avf; 
    5555    char *format;          ///< format to use for output segment files 
    5656    char *list;            ///< filename for the segment list file 
     57    int   list_count;      ///< list counter 
    5758    int   list_size;       ///< number of entries for the segment list file 
    5859    double list_max_segment_time; ///< max segment time in the current list 
    5960    ListType list_type;    ///< set the list type 
    static int segment_list_open(AVFormatContext *s) 
    152153    if (seg->list_type == LIST_TYPE_M3U8) { 
    153154        avio_printf(seg->list_pb, "#EXTM3U\n"); 
    154155        avio_printf(seg->list_pb, "#EXT-X-VERSION:3\n"); 
     156        avio_printf(seg->list_pb, "#EXT-X-MEDIA-SEQUENCE:%d\n", seg->list_count); 
    155157    } 
    156158 
    157159    return ret; 
    static void segment_list_close(AVFormatContext *s) 
    166168                    (int)ceil(seg->list_max_segment_time)); 
    167169        avio_printf(seg->list_pb, "#EXT-X-ENDLIST\n"); 
    168170    } 
     171    seg->list_count++; 
    169172 
    170173    avio_close(seg->list_pb); 
    171174}