[FFmpeg-devel] [PATCH 1/4] avformat/hlsenc: Add init_program_date_time so start time can be specified

Marton Balint cus at passwd.hu
Sun Nov 5 10:20:47 EET 2023



On Fri, 27 Oct 2023, David Johansen wrote:

> On Fri, Oct 27, 2023 at 4:58 AM <epirat07 at gmail.com> wrote:
>
>> On 27 Oct 2023, at 5:59, Dave Johansen wrote:
>> >  @item second_level_segment_index
>> >  Makes it possible to use segment indexes as %%d in hls_segment_filename
>> expression
>> >  besides date/time values when strftime is on.
>> > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> > index 4ef84c05c1..5dfff6b2b6 100644
>> > --- a/libavformat/hlsenc.c
>> > +++ b/libavformat/hlsenc.c
>> > @@ -212,6 +212,8 @@ typedef struct HLSContext {
>> >      int64_t recording_time;
>> >      int64_t max_seg_size; // every segment file max size
>> >
>> > +    char *init_program_date_time;
>> > +
>> >      char *baseurl;
>> >      char *vtt_format_options_str;
>> >      char *subtitle_filename;
>> > @@ -1192,6 +1194,25 @@ static int hls_append_segment(struct
>> AVFormatContext *s, HLSContext *hls,
>> >      return 0;
>> >  }
>> >
>> > +static double parse_iso8601(const char *ptr) {

Please use the existing function av_parse_time(). That can more completely 
handle ISO8601 and even more.

Regards,
Marton


More information about the ffmpeg-devel mailing list