static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts)

{

    int ret, i;

    ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE,

                     &s->interrupt_callback, NULL);

    if (ret < 0)

        return ret;

    avio_wb32(os->out, 0);

    avio_wl32(os->out, MKTAG('m','d','a','t'));

    for (i = 0; i < os->nb_extra_packets; i++) {

        AV_WB24(os->extra_packets[i] + 4, start_ts);

        os->extra_packets[i][7] = (start_ts >> 24) & 0x7f;

        avio_write(os->out, os->extra_packets[i], os->extra_packet_sizes[i]);

    }

    return 0;

}

static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts)

{

    int ret, i;

    ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE,

                     &s->interrupt_callback, NULL);

    if (ret < 0)

        return ret;

    avio_wb32(os->out, 0);

    avio_wl32(os->out, MKTAG('m','d','a','t'));

    for (i = 0; i < os->nb_extra_packets; i++) {

        AV_WB24(os->extra_packets[i] + 4, start_ts);

        os->extra_packets[i][7] = (start_ts >> 24) & 0x7f;

        avio_write(os->out, os->extra_packets[i], os->extra_packet_sizes[i]);

    }

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, OutputStream *VAR_1, int64_t VAR_2)

{

    int VAR_3, VAR_4;

    VAR_3 = avio_open2(&VAR_1->out, VAR_1->temp_filename, AVIO_FLAG_WRITE,

                     &VAR_0->interrupt_callback, NULL);

    if (VAR_3 < 0)

        return VAR_3;

    avio_wb32(VAR_1->out, 0);

    avio_wl32(VAR_1->out, MKTAG('m','d','a','t'));

    for (VAR_4 = 0; VAR_4 < VAR_1->nb_extra_packets; VAR_4++) {

        AV_WB24(VAR_1->extra_packets[VAR_4] + 4, VAR_2);

        VAR_1->extra_packets[VAR_4][7] = (VAR_2 >> 24) & 0x7f;

        avio_write(VAR_1->out, VAR_1->extra_packets[VAR_4], VAR_1->extra_packet_sizes[VAR_4]);

    }

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, OutputStream *VAR_1, int64_t VAR_2)
{ int VAR_3, VAR_4; VAR_3 = avio_open2(&VAR_1->out, VAR_1->temp_filename, AVIO_FLAG_WRITE,
&VAR_0->interrupt_callback, NULL); if (VAR_3 < 0)
return VAR_3; avio_wb32(VAR_1->out, 0); avio_wl32(VAR_1->out, MKTAG('m','d','a','t')); for (VAR_4 = 0; VAR_4 < VAR_1->nb_extra_packets; VAR_4++) { AV_WB24(VAR_1->extra_packets[VAR_4] + 4, VAR_2); VAR_1->extra_packets[VAR_4][7] = (VAR_2 >> 24) & 0x7f; avio_write(VAR_1->out, VAR_1->extra_packets[VAR_4], VAR_1->extra_packet_sizes[VAR_4]); } return 0; }