static void mp3_update_xing(AVFormatContext *s)

{

    MP3Context  *mp3 = s->priv_data;

    int i;



    /* replace "Xing" identification string with "Info" for CBR files. */

    if (!mp3->has_variable_bitrate) {

        avio_seek(s->pb, mp3->xing_offset, SEEK_SET);

        ffio_wfourcc(s->pb, "Info");

    }



    avio_seek(s->pb, mp3->xing_offset + 8, SEEK_SET);

    avio_wb32(s->pb, mp3->frames);

    avio_wb32(s->pb, mp3->size);



    avio_w8(s->pb, 0);  // first toc entry has to be zero.



    for (i = 1; i < XING_TOC_SIZE; ++i) {

        int j = i * mp3->pos / XING_TOC_SIZE;

        int seek_point = 256LL * mp3->bag[j] / mp3->size;

        avio_w8(s->pb, FFMIN(seek_point, 255));

    }



    avio_seek(s->pb, 0, SEEK_END);

}

static void mp3_update_xing(AVFormatContext *s)

{

    MP3Context  *mp3 = s->priv_data;

    int i;



    

    if (!mp3->has_variable_bitrate) {

        avio_seek(s->pb, mp3->xing_offset, SEEK_SET);

        ffio_wfourcc(s->pb, "Info");

    }



    avio_seek(s->pb, mp3->xing_offset + 8, SEEK_SET);

    avio_wb32(s->pb, mp3->frames);

    avio_wb32(s->pb, mp3->size);



    avio_w8(s->pb, 0);  



    for (i = 1; i < XING_TOC_SIZE; ++i) {

        int j = i * mp3->pos / XING_TOC_SIZE;

        int seek_point = 256LL * mp3->bag[j] / mp3->size;

        avio_w8(s->pb, FFMIN(seek_point, 255));

    }



    avio_seek(s->pb, 0, SEEK_END);

}

static void FUNC_0(AVFormatContext *VAR_0)

{

    MP3Context  *mp3 = VAR_0->priv_data;

    int VAR_1;



    

    if (!mp3->has_variable_bitrate) {

        avio_seek(VAR_0->pb, mp3->xing_offset, SEEK_SET);

        ffio_wfourcc(VAR_0->pb, "Info");

    }



    avio_seek(VAR_0->pb, mp3->xing_offset + 8, SEEK_SET);

    avio_wb32(VAR_0->pb, mp3->frames);

    avio_wb32(VAR_0->pb, mp3->size);



    avio_w8(VAR_0->pb, 0);  



    for (VAR_1 = 1; VAR_1 < XING_TOC_SIZE; ++VAR_1) {

        int j = VAR_1 * mp3->pos / XING_TOC_SIZE;

        int seek_point = 256LL * mp3->bag[j] / mp3->size;

        avio_w8(VAR_0->pb, FFMIN(seek_point, 255));

    }



    avio_seek(VAR_0->pb, 0, SEEK_END);

}

static void FUNC_0(AVFormatContext *VAR_0)
{ MP3Context  *mp3 = VAR_0->priv_data; int VAR_1; if (!mp3->has_variable_bitrate) { avio_seek(VAR_0->pb, mp3->xing_offset, SEEK_SET); ffio_wfourcc(VAR_0->pb, "Info"); } avio_seek(VAR_0->pb, mp3->xing_offset + 8, SEEK_SET); avio_wb32(VAR_0->pb, mp3->frames); avio_wb32(VAR_0->pb, mp3->size); avio_w8(VAR_0->pb, 0); for (VAR_1 = 1; VAR_1 < XING_TOC_SIZE; ++VAR_1) { int j = VAR_1 * mp3->pos / XING_TOC_SIZE; int seek_point = 256LL * mp3->bag[j] / mp3->size; avio_w8(VAR_0->pb, FFMIN(seek_point, 255)); } avio_seek(VAR_0->pb, 0, SEEK_END); }