start_number option starts the playlist sequence number
(#EXT-X-MEDIA-SEQUENCE) from the specified number. Unless hls_flags
single_file is set, it also specifies starting sequence numbers of
segment and subtitle filenames. Sometimes it is usefull to have unique
starting numbers at each run, but currently it is only achiveable by
setting this parameter manually.
This patch enables to specify start_number source parameter by
introducing hls_start_number_source with 3 possible values:
generic/epoch/datetime. This ensures to set start sequence number
automatically for practically unique numbers. Generic option is the
default and this is the curent behaviour: start_number option value
specifies the start sequence number. (start_number default value is 0)
If hls_start_number_source is set to epoch, then the start number will
be the seconds since epoch (1970-01-01 00:00:00). If set to datetime,
then the start sequence number will be based on the current date/time
value as YYYYmmddHHMMSS. e.g. 20161231235659.
Hls speficication allows 64 bit integers as sequence numbers. This patch
also changes some code where only 32 bit integer values were handled
correctly.
Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
{"method","set the HTTP method",OFFSET(method),AV_OPT_TYPE_STRING,{.str=NULL},0,0,E},
{"method","set the HTTP method",OFFSET(method),AV_OPT_TYPE_STRING,{.str=NULL},0,0,E},
{"hls_start_number_source","set source of first number in sequence",OFFSET(start_sequence_source_type),AV_OPT_TYPE_INT,{.i64=HLS_START_SEQUNCE_AS_START_NUMBER},0,HLS_START_SEQUNCE_AS_FORMATTED_DATETIME,E,"start_sequence_source_type"},
{"generic","start_number value (default)",0,AV_OPT_TYPE_CONST,{.i64=HLS_START_SEQUNCE_AS_START_NUMBER},INT_MIN,INT_MAX,E,"start_sequence_source_type"},
{"epoch","seconds since epoch",0,AV_OPT_TYPE_CONST,{.i64=HLS_START_SEQUNCE_AS_SECONDS_SINCE_EPOCH},INT_MIN,INT_MAX,E,"start_sequence_source_type"},
{"datetime","current datetime as YYYYMMDDhhmmss",0,AV_OPT_TYPE_CONST,{.i64=HLS_START_SEQUNCE_AS_FORMATTED_DATETIME},INT_MIN,INT_MAX,E,"start_sequence_source_type"},