static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c,

                                int representation_id, int final)

{

    int i, start_index = 0, start_number = 1;

    if (c->window_size) {

        start_index  = FFMAX(os->nb_segments   - c->window_size, 0);

        start_number = FFMAX(os->segment_index - c->window_size, 1);

    }



    if (c->use_template) {

        int timescale = c->use_timeline ? os->ctx->streams[0]->time_base.den : AV_TIME_BASE;

        avio_printf(out, "\t\t\t\t<SegmentTemplate timescale=\"%d\" ", timescale);

        if (!c->use_timeline)

            avio_printf(out, "duration=\"%"PRId64"\" ", c->last_duration);

        avio_printf(out, "initialization=\"%s\" media=\"%s\" startNumber=\"%d\">\n", c->init_seg_name, c->media_seg_name, c->use_timeline ? start_number : 1);

        if (c->use_timeline) {

            int64_t cur_time = 0;

            avio_printf(out, "\t\t\t\t\t<SegmentTimeline>\n");

            for (i = start_index; i < os->nb_segments; ) {

                Segment *seg = os->segments[i];

                int repeat = 0;

                avio_printf(out, "\t\t\t\t\t\t<S ");

                if (i == start_index || seg->time != cur_time) {

                    cur_time = seg->time;

                    avio_printf(out, "t=\"%"PRId64"\" ", seg->time);

                }

                avio_printf(out, "d=\"%d\" ", seg->duration);

                while (i + repeat + 1 < os->nb_segments &&

                       os->segments[i + repeat + 1]->duration == seg->duration &&

                       os->segments[i + repeat + 1]->time == os->segments[i + repeat]->time + os->segments[i + repeat]->duration)

                    repeat++;

                if (repeat > 0)

                    avio_printf(out, "r=\"%d\" ", repeat);

                avio_printf(out, "/>\n");

                i += 1 + repeat;

                cur_time += (1 + repeat) * seg->duration;

            }

            avio_printf(out, "\t\t\t\t\t</SegmentTimeline>\n");

        }

        avio_printf(out, "\t\t\t\t</SegmentTemplate>\n");

    } else if (c->single_file) {

        avio_printf(out, "\t\t\t\t<BaseURL>%s</BaseURL>\n", os->initfile);

        avio_printf(out, "\t\t\t\t<SegmentList timescale=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, c->last_duration, start_number);

        avio_printf(out, "\t\t\t\t\t<Initialization range=\"%"PRId64"-%"PRId64"\" />\n", os->init_start_pos, os->init_start_pos + os->init_range_length - 1);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            avio_printf(out, "\t\t\t\t\t<SegmentURL mediaRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->range_length - 1);

            if (seg->index_length)

                avio_printf(out, "indexRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->index_length - 1);

            avio_printf(out, "/>\n");

        }

        avio_printf(out, "\t\t\t\t</SegmentList>\n");

    } else {

        avio_printf(out, "\t\t\t\t<SegmentList timescale=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, c->last_duration, start_number);

        avio_printf(out, "\t\t\t\t\t<Initialization sourceURL=\"%s\" />\n", os->initfile);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            avio_printf(out, "\t\t\t\t\t<SegmentURL media=\"%s\" />\n", seg->file);

        }

        avio_printf(out, "\t\t\t\t</SegmentList>\n");

    }

    if (c->hls_playlist && start_index < os->nb_segments)

    {

        int timescale = os->ctx->streams[0]->time_base.den;

        char temp_filename_hls[1024];

        char filename_hls[1024];

        AVIOContext *out_hls = NULL;

        AVDictionary *http_opts = NULL;

        int target_duration = 0;

        int ret = 0;

        const char *proto = avio_find_protocol_name(c->dirname);

        int use_rename = proto && !strcmp(proto, "file");



        get_hls_playlist_name(filename_hls, sizeof(filename_hls),

                              c->dirname, representation_id);



        snprintf(temp_filename_hls, sizeof(temp_filename_hls), use_rename ? "%s.tmp" : "%s", filename_hls);



        set_http_options(&http_opts, c);

        avio_open2(&out_hls, temp_filename_hls, AVIO_FLAG_WRITE, NULL, &http_opts);

        av_dict_free(&http_opts);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            double duration = (double) seg->duration / timescale;

            if (target_duration <= duration)

                target_duration = hls_get_int_from_double(duration);

        }



        ff_hls_write_playlist_header(out_hls, 6, -1, target_duration,

                                     start_number, PLAYLIST_TYPE_NONE);



        ff_hls_write_init_file(out_hls, os->initfile, c->single_file,

                               os->init_range_length, os->init_start_pos);



        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            ret = ff_hls_write_file_entry(out_hls, 0, c->single_file,

                                    (double) seg->duration / timescale, 0,

                                    seg->range_length, seg->start_pos, NULL,

                                    c->single_file ? os->initfile : seg->file,

                                    NULL);

            if (ret < 0) {

                av_log(os->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");

            }

        }



        if (final)

            ff_hls_write_end_list(out_hls);



        avio_close(out_hls);

        if (use_rename)

            avpriv_io_move(temp_filename_hls, filename_hls);

    }



}

static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext *c,

                                int representation_id, int final)

{

    int i, start_index = 0, start_number = 1;

    if (c->window_size) {

        start_index  = FFMAX(os->nb_segments   - c->window_size, 0);

        start_number = FFMAX(os->segment_index - c->window_size, 1);

    }



    if (c->use_template) {

        int timescale = c->use_timeline ? os->ctx->streams[0]->time_base.den : AV_TIME_BASE;

        avio_printf(out, "\t\t\t\t<SegmentTemplate timescale=\"%d\" ", timescale);

        if (!c->use_timeline)

            avio_printf(out, "duration=\"%"PRId64"\" ", c->last_duration);

        avio_printf(out, "initialization=\"%s\" media=\"%s\" startNumber=\"%d\">\n", c->init_seg_name, c->media_seg_name, c->use_timeline ? start_number : 1);

        if (c->use_timeline) {

            int64_t cur_time = 0;

            avio_printf(out, "\t\t\t\t\t<SegmentTimeline>\n");

            for (i = start_index; i < os->nb_segments; ) {

                Segment *seg = os->segments[i];

                int repeat = 0;

                avio_printf(out, "\t\t\t\t\t\t<S ");

                if (i == start_index || seg->time != cur_time) {

                    cur_time = seg->time;

                    avio_printf(out, "t=\"%"PRId64"\" ", seg->time);

                }

                avio_printf(out, "d=\"%d\" ", seg->duration);

                while (i + repeat + 1 < os->nb_segments &&

                       os->segments[i + repeat + 1]->duration == seg->duration &&

                       os->segments[i + repeat + 1]->time == os->segments[i + repeat]->time + os->segments[i + repeat]->duration)

                    repeat++;

                if (repeat > 0)

                    avio_printf(out, "r=\"%d\" ", repeat);

                avio_printf(out, "/>\n");

                i += 1 + repeat;

                cur_time += (1 + repeat) * seg->duration;

            }

            avio_printf(out, "\t\t\t\t\t</SegmentTimeline>\n");

        }

        avio_printf(out, "\t\t\t\t</SegmentTemplate>\n");

    } else if (c->single_file) {

        avio_printf(out, "\t\t\t\t<BaseURL>%s</BaseURL>\n", os->initfile);

        avio_printf(out, "\t\t\t\t<SegmentList timescale=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, c->last_duration, start_number);

        avio_printf(out, "\t\t\t\t\t<Initialization range=\"%"PRId64"-%"PRId64"\" />\n", os->init_start_pos, os->init_start_pos + os->init_range_length - 1);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            avio_printf(out, "\t\t\t\t\t<SegmentURL mediaRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->range_length - 1);

            if (seg->index_length)

                avio_printf(out, "indexRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->index_length - 1);

            avio_printf(out, "/>\n");

        }

        avio_printf(out, "\t\t\t\t</SegmentList>\n");

    } else {

        avio_printf(out, "\t\t\t\t<SegmentList timescale=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, c->last_duration, start_number);

        avio_printf(out, "\t\t\t\t\t<Initialization sourceURL=\"%s\" />\n", os->initfile);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            avio_printf(out, "\t\t\t\t\t<SegmentURL media=\"%s\" />\n", seg->file);

        }

        avio_printf(out, "\t\t\t\t</SegmentList>\n");

    }

    if (c->hls_playlist && start_index < os->nb_segments)

    {

        int timescale = os->ctx->streams[0]->time_base.den;

        char temp_filename_hls[1024];

        char filename_hls[1024];

        AVIOContext *out_hls = NULL;

        AVDictionary *http_opts = NULL;

        int target_duration = 0;

        int ret = 0;

        const char *proto = avio_find_protocol_name(c->dirname);

        int use_rename = proto && !strcmp(proto, "file");



        get_hls_playlist_name(filename_hls, sizeof(filename_hls),

                              c->dirname, representation_id);



        snprintf(temp_filename_hls, sizeof(temp_filename_hls), use_rename ? "%s.tmp" : "%s", filename_hls);



        set_http_options(&http_opts, c);

        avio_open2(&out_hls, temp_filename_hls, AVIO_FLAG_WRITE, NULL, &http_opts);

        av_dict_free(&http_opts);

        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            double duration = (double) seg->duration / timescale;

            if (target_duration <= duration)

                target_duration = hls_get_int_from_double(duration);

        }



        ff_hls_write_playlist_header(out_hls, 6, -1, target_duration,

                                     start_number, PLAYLIST_TYPE_NONE);



        ff_hls_write_init_file(out_hls, os->initfile, c->single_file,

                               os->init_range_length, os->init_start_pos);



        for (i = start_index; i < os->nb_segments; i++) {

            Segment *seg = os->segments[i];

            ret = ff_hls_write_file_entry(out_hls, 0, c->single_file,

                                    (double) seg->duration / timescale, 0,

                                    seg->range_length, seg->start_pos, NULL,

                                    c->single_file ? os->initfile : seg->file,

                                    NULL);

            if (ret < 0) {

                av_log(os->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");

            }

        }



        if (final)

            ff_hls_write_end_list(out_hls);



        avio_close(out_hls);

        if (use_rename)

            avpriv_io_move(temp_filename_hls, filename_hls);

    }



}

static void FUNC_0(OutputStream *VAR_0, AVIOContext *VAR_1, DASHContext *VAR_2,

                                int VAR_3, int VAR_4)

{

    int VAR_5, VAR_6 = 0, VAR_7 = 1;

    if (VAR_2->window_size) {

        VAR_6  = FFMAX(VAR_0->nb_segments   - VAR_2->window_size, 0);

        VAR_7 = FFMAX(VAR_0->segment_index - VAR_2->window_size, 1);

    }



    if (VAR_2->use_template) {

        int VAR_9 = VAR_2->use_timeline ? VAR_0->ctx->streams[0]->time_base.den : AV_TIME_BASE;

        avio_printf(VAR_1, "\t\t\t\t<SegmentTemplate VAR_9=\"%d\" ", VAR_9);

        if (!VAR_2->use_timeline)

            avio_printf(VAR_1, "duration=\"%"PRId64"\" ", VAR_2->last_duration);

        avio_printf(VAR_1, "initialization=\"%s\" media=\"%s\" startNumber=\"%d\">\n", VAR_2->init_seg_name, VAR_2->media_seg_name, VAR_2->use_timeline ? VAR_7 : 1);

        if (VAR_2->use_timeline) {

            int64_t cur_time = 0;

            avio_printf(VAR_1, "\t\t\t\t\t<SegmentTimeline>\n");

            for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; ) {

                Segment *seg = VAR_0->segments[VAR_5];

                int repeat = 0;

                avio_printf(VAR_1, "\t\t\t\t\t\t<S ");

                if (VAR_5 == VAR_6 || seg->time != cur_time) {

                    cur_time = seg->time;

                    avio_printf(VAR_1, "t=\"%"PRId64"\" ", seg->time);

                }

                avio_printf(VAR_1, "d=\"%d\" ", seg->duration);

                while (VAR_5 + repeat + 1 < VAR_0->nb_segments &&

                       VAR_0->segments[VAR_5 + repeat + 1]->duration == seg->duration &&

                       VAR_0->segments[VAR_5 + repeat + 1]->time == VAR_0->segments[VAR_5 + repeat]->time + VAR_0->segments[VAR_5 + repeat]->duration)

                    repeat++;

                if (repeat > 0)

                    avio_printf(VAR_1, "r=\"%d\" ", repeat);

                avio_printf(VAR_1, "/>\n");

                VAR_5 += 1 + repeat;

                cur_time += (1 + repeat) * seg->duration;

            }

            avio_printf(VAR_1, "\t\t\t\t\t</SegmentTimeline>\n");

        }

        avio_printf(VAR_1, "\t\t\t\t</SegmentTemplate>\n");

    } else if (VAR_2->single_file) {

        avio_printf(VAR_1, "\t\t\t\t<BaseURL>%s</BaseURL>\n", VAR_0->initfile);

        avio_printf(VAR_1, "\t\t\t\t<SegmentList VAR_9=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, VAR_2->last_duration, VAR_7);

        avio_printf(VAR_1, "\t\t\t\t\t<Initialization range=\"%"PRId64"-%"PRId64"\" />\n", VAR_0->init_start_pos, VAR_0->init_start_pos + VAR_0->init_range_length - 1);

        for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) {

            Segment *seg = VAR_0->segments[VAR_5];

            avio_printf(VAR_1, "\t\t\t\t\t<SegmentURL mediaRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->range_length - 1);

            if (seg->index_length)

                avio_printf(VAR_1, "indexRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->index_length - 1);

            avio_printf(VAR_1, "/>\n");

        }

        avio_printf(VAR_1, "\t\t\t\t</SegmentList>\n");

    } else {

        avio_printf(VAR_1, "\t\t\t\t<SegmentList VAR_9=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, VAR_2->last_duration, VAR_7);

        avio_printf(VAR_1, "\t\t\t\t\t<Initialization sourceURL=\"%s\" />\n", VAR_0->initfile);

        for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) {

            Segment *seg = VAR_0->segments[VAR_5];

            avio_printf(VAR_1, "\t\t\t\t\t<SegmentURL media=\"%s\" />\n", seg->file);

        }

        avio_printf(VAR_1, "\t\t\t\t</SegmentList>\n");

    }

    if (VAR_2->hls_playlist && VAR_6 < VAR_0->nb_segments)

    {

        int VAR_9 = VAR_0->ctx->streams[0]->time_base.den;

        char VAR_9[1024];

        char VAR_10[1024];

        AVIOContext *out_hls = NULL;

        AVDictionary *http_opts = NULL;

        int VAR_11 = 0;

        int VAR_12 = 0;

        const char *VAR_13 = avio_find_protocol_name(VAR_2->dirname);

        int VAR_14 = VAR_13 && !strcmp(VAR_13, "file");



        get_hls_playlist_name(VAR_10, sizeof(VAR_10),

                              VAR_2->dirname, VAR_3);



        snprintf(VAR_9, sizeof(VAR_9), VAR_14 ? "%s.tmp" : "%s", VAR_10);



        set_http_options(&http_opts, VAR_2);

        avio_open2(&out_hls, VAR_9, AVIO_FLAG_WRITE, NULL, &http_opts);

        av_dict_free(&http_opts);

        for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) {

            Segment *seg = VAR_0->segments[VAR_5];

            double duration = (double) seg->duration / VAR_9;

            if (VAR_11 <= duration)

                VAR_11 = hls_get_int_from_double(duration);

        }



        ff_hls_write_playlist_header(out_hls, 6, -1, VAR_11,

                                     VAR_7, PLAYLIST_TYPE_NONE);



        ff_hls_write_init_file(out_hls, VAR_0->initfile, VAR_2->single_file,

                               VAR_0->init_range_length, VAR_0->init_start_pos);



        for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) {

            Segment *seg = VAR_0->segments[VAR_5];

            VAR_12 = ff_hls_write_file_entry(out_hls, 0, VAR_2->single_file,

                                    (double) seg->duration / VAR_9, 0,

                                    seg->range_length, seg->start_pos, NULL,

                                    VAR_2->single_file ? VAR_0->initfile : seg->file,

                                    NULL);

            if (VAR_12 < 0) {

                av_log(VAR_0->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");

            }

        }



        if (VAR_4)

            ff_hls_write_end_list(out_hls);



        avio_close(out_hls);

        if (VAR_14)

            avpriv_io_move(VAR_9, VAR_10);

    }



}

static void FUNC_0(OutputStream *VAR_0, AVIOContext *VAR_1, DASHContext *VAR_2,
int VAR_3, int VAR_4)
{ int VAR_5, VAR_6 = 0, VAR_7 = 1; if (VAR_2->window_size) { VAR_6  = FFMAX(VAR_0->nb_segments   - VAR_2->window_size, 0); VAR_7 = FFMAX(VAR_0->segment_index - VAR_2->window_size, 1); } if (VAR_2->use_template) { int VAR_9 = VAR_2->use_timeline ? VAR_0->ctx->streams[0]->time_base.den : AV_TIME_BASE; avio_printf(VAR_1, "\t\t\t\t<SegmentTemplate VAR_9=\"%d\" ", VAR_9); if (!VAR_2->use_timeline)
avio_printf(VAR_1, "duration=\"%"PRId64"\" ", VAR_2->last_duration); avio_printf(VAR_1, "initialization=\"%s\" media=\"%s\" startNumber=\"%d\">\n", VAR_2->init_seg_name, VAR_2->media_seg_name, VAR_2->use_timeline ? VAR_7 : 1); if (VAR_2->use_timeline) { int64_t cur_time = 0; avio_printf(VAR_1, "\t\t\t\t\t<SegmentTimeline>\n"); for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; ) { Segment *seg = VAR_0->segments[VAR_5]; int repeat = 0; avio_printf(VAR_1, "\t\t\t\t\t\t<S "); if (VAR_5 == VAR_6 || seg->time != cur_time) { cur_time = seg->time; avio_printf(VAR_1, "t=\"%"PRId64"\" ", seg->time); } avio_printf(VAR_1, "d=\"%d\" ", seg->duration); while (VAR_5 + repeat + 1 < VAR_0->nb_segments &&
VAR_0->segments[VAR_5 + repeat + 1]->duration == seg->duration &&
VAR_0->segments[VAR_5 + repeat + 1]->time == VAR_0->segments[VAR_5 + repeat]->time + VAR_0->segments[VAR_5 + repeat]->duration)
repeat++; if (repeat > 0)
avio_printf(VAR_1, "r=\"%d\" ", repeat); avio_printf(VAR_1, "/>\n"); VAR_5 += 1 + repeat; cur_time += (1 + repeat) * seg->duration; } avio_printf(VAR_1, "\t\t\t\t\t</SegmentTimeline>\n"); } avio_printf(VAR_1, "\t\t\t\t</SegmentTemplate>\n"); } else if (VAR_2->single_file) { avio_printf(VAR_1, "\t\t\t\t<BaseURL>%s</BaseURL>\n", VAR_0->initfile); avio_printf(VAR_1, "\t\t\t\t<SegmentList VAR_9=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, VAR_2->last_duration, VAR_7); avio_printf(VAR_1, "\t\t\t\t\t<Initialization range=\"%"PRId64"-%"PRId64"\" />\n", VAR_0->init_start_pos, VAR_0->init_start_pos + VAR_0->init_range_length - 1); for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) { Segment *seg = VAR_0->segments[VAR_5]; avio_printf(VAR_1, "\t\t\t\t\t<SegmentURL mediaRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->range_length - 1); if (seg->index_length)
avio_printf(VAR_1, "indexRange=\"%"PRId64"-%"PRId64"\" ", seg->start_pos, seg->start_pos + seg->index_length - 1); avio_printf(VAR_1, "/>\n"); } avio_printf(VAR_1, "\t\t\t\t</SegmentList>\n"); } else { avio_printf(VAR_1, "\t\t\t\t<SegmentList VAR_9=\"%d\" duration=\"%"PRId64"\" startNumber=\"%d\">\n", AV_TIME_BASE, VAR_2->last_duration, VAR_7); avio_printf(VAR_1, "\t\t\t\t\t<Initialization sourceURL=\"%s\" />\n", VAR_0->initfile); for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) { Segment *seg = VAR_0->segments[VAR_5]; avio_printf(VAR_1, "\t\t\t\t\t<SegmentURL media=\"%s\" />\n", seg->file); } avio_printf(VAR_1, "\t\t\t\t</SegmentList>\n"); } if (VAR_2->hls_playlist && VAR_6 < VAR_0->nb_segments)
{ int VAR_9 = VAR_0->ctx->streams[0]->time_base.den; char VAR_9[1024]; char VAR_10[1024]; AVIOContext *out_hls = NULL; AVDictionary *http_opts = NULL; int VAR_11 = 0; int VAR_12 = 0; const char *VAR_13 = avio_find_protocol_name(VAR_2->dirname); int VAR_14 = VAR_13 && !strcmp(VAR_13, "file"); get_hls_playlist_name(VAR_10, sizeof(VAR_10),
VAR_2->dirname, VAR_3); snprintf(VAR_9, sizeof(VAR_9), VAR_14 ? "%s.tmp" : "%s", VAR_10); set_http_options(&http_opts, VAR_2); avio_open2(&out_hls, VAR_9, AVIO_FLAG_WRITE, NULL, &http_opts); av_dict_free(&http_opts); for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) { Segment *seg = VAR_0->segments[VAR_5]; double duration = (double) seg->duration / VAR_9; if (VAR_11 <= duration)
VAR_11 = hls_get_int_from_double(duration); } ff_hls_write_playlist_header(out_hls, 6, -1, VAR_11,
VAR_7, PLAYLIST_TYPE_NONE); ff_hls_write_init_file(out_hls, VAR_0->initfile, VAR_2->single_file,
VAR_0->init_range_length, VAR_0->init_start_pos); for (VAR_5 = VAR_6; VAR_5 < VAR_0->nb_segments; VAR_5++) { Segment *seg = VAR_0->segments[VAR_5]; VAR_12 = ff_hls_write_file_entry(out_hls, 0, VAR_2->single_file,
(double) seg->duration / VAR_9, 0,
seg->range_length, seg->start_pos, NULL,
VAR_2->single_file ? VAR_0->initfile : seg->file,
NULL); if (VAR_12 < 0) { av_log(VAR_0->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n"); } } if (VAR_4)
ff_hls_write_end_list(out_hls); avio_close(out_hls); if (VAR_14)
avpriv_io_move(VAR_9, VAR_10); } }