static int write_fragments(struct Tracks *tracks, int start_index,

                           AVIOContext *in)

{

    char dirname[100], filename[500];

    int i, j;



    for (i = start_index; i < tracks->nb_tracks; i++) {

        struct Track *track = tracks->tracks[i];

        const char *type    = track->is_video ? "video" : "audio";

        snprintf(dirname, sizeof(dirname), "QualityLevels(%d)", track->bitrate);

        mkdir(dirname, 0777);

        for (j = 0; j < track->chunks; j++) {

            snprintf(filename, sizeof(filename), "%s/Fragments(%s=%"PRId64")",

                     dirname, type, track->offsets[j].time);

            avio_seek(in, track->offsets[j].offset, SEEK_SET);

            write_fragment(filename, in);

        }

    }

    return 0;

}

static int write_fragments(struct Tracks *tracks, int start_index,

                           AVIOContext *in)

{

    char dirname[100], filename[500];

    int i, j;



    for (i = start_index; i < tracks->nb_tracks; i++) {

        struct Track *track = tracks->tracks[i];

        const char *type    = track->is_video ? "video" : "audio";

        snprintf(dirname, sizeof(dirname), "QualityLevels(%d)", track->bitrate);

        mkdir(dirname, 0777);

        for (j = 0; j < track->chunks; j++) {

            snprintf(filename, sizeof(filename), "%s/Fragments(%s=%"PRId64")",

                     dirname, type, track->offsets[j].time);

            avio_seek(in, track->offsets[j].offset, SEEK_SET);

            write_fragment(filename, in);

        }

    }

    return 0;

}

static int FUNC_0(struct Tracks *VAR_0, int VAR_1,

                           AVIOContext *VAR_2)

{

    char VAR_3[100], VAR_4[500];

    int VAR_5, VAR_6;



    for (VAR_5 = VAR_1; VAR_5 < VAR_0->nb_tracks; VAR_5++) {

        struct Track *VAR_7 = VAR_0->VAR_0[VAR_5];

        const char *VAR_8    = VAR_7->is_video ? "video" : "audio";

        snprintf(VAR_3, sizeof(VAR_3), "QualityLevels(%d)", VAR_7->bitrate);

        mkdir(VAR_3, 0777);

        for (VAR_6 = 0; VAR_6 < VAR_7->chunks; VAR_6++) {

            snprintf(VAR_4, sizeof(VAR_4), "%s/Fragments(%s=%"PRId64")",

                     VAR_3, VAR_8, VAR_7->offsets[VAR_6].time);

            avio_seek(VAR_2, VAR_7->offsets[VAR_6].offset, SEEK_SET);

            write_fragment(VAR_4, VAR_2);

        }

    }

    return 0;

}

static int FUNC_0(struct Tracks *VAR_0, int VAR_1,
AVIOContext *VAR_2)
{ char VAR_3[100], VAR_4[500]; int VAR_5, VAR_6; for (VAR_5 = VAR_1; VAR_5 < VAR_0->nb_tracks; VAR_5++) { struct Track *VAR_7 = VAR_0->VAR_0[VAR_5]; const char *VAR_8    = VAR_7->is_video ? "video" : "audio"; snprintf(VAR_3, sizeof(VAR_3), "QualityLevels(%d)", VAR_7->bitrate); mkdir(VAR_3, 0777); for (VAR_6 = 0; VAR_6 < VAR_7->chunks; VAR_6++) { snprintf(VAR_4, sizeof(VAR_4), "%s/Fragments(%s=%"PRId64")",
VAR_3, VAR_8, VAR_7->offsets[VAR_6].time); avio_seek(VAR_2, VAR_7->offsets[VAR_6].offset, SEEK_SET); write_fragment(VAR_4, VAR_2); } } return 0; }