static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration)

{

    int i;

    MP3DecContext *mp3 = s->priv_data;

    int fill_index = mp3->usetoc == 1 && duration > 0;



    if (!filesize &&

        !(filesize = avio_size(s->pb))) {

        av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");

        fill_index = 0;

    }



    for (i = 0; i < XING_TOC_COUNT; i++) {

        uint8_t b = avio_r8(s->pb);

        if (fill_index)

            av_add_index_entry(s->streams[0],

                           av_rescale(b, filesize, 256),

                           av_rescale(i, duration, XING_TOC_COUNT),

                           0, 0, AVINDEX_KEYFRAME);

    }

    if (fill_index)

        mp3->xing_toc = 1;

}

static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration)

{

    int i;

    MP3DecContext *mp3 = s->priv_data;

    int fill_index = mp3->usetoc == 1 && duration > 0;



    if (!filesize &&

        !(filesize = avio_size(s->pb))) {

        av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");

        fill_index = 0;

    }



    for (i = 0; i < XING_TOC_COUNT; i++) {

        uint8_t b = avio_r8(s->pb);

        if (fill_index)

            av_add_index_entry(s->streams[0],

                           av_rescale(b, filesize, 256),

                           av_rescale(i, duration, XING_TOC_COUNT),

                           0, 0, AVINDEX_KEYFRAME);

    }

    if (fill_index)

        mp3->xing_toc = 1;

}

static void FUNC_0(AVFormatContext *VAR_0, int64_t VAR_1, int64_t VAR_2)

{

    int VAR_3;

    MP3DecContext *mp3 = VAR_0->priv_data;

    int VAR_4 = mp3->usetoc == 1 && VAR_2 > 0;



    if (!VAR_1 &&

        !(VAR_1 = avio_size(VAR_0->pb))) {

        av_log(VAR_0, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");

        VAR_4 = 0;

    }



    for (VAR_3 = 0; VAR_3 < XING_TOC_COUNT; VAR_3++) {

        uint8_t b = avio_r8(VAR_0->pb);

        if (VAR_4)

            av_add_index_entry(VAR_0->streams[0],

                           av_rescale(b, VAR_1, 256),

                           av_rescale(VAR_3, VAR_2, XING_TOC_COUNT),

                           0, 0, AVINDEX_KEYFRAME);

    }

    if (VAR_4)

        mp3->xing_toc = 1;

}

static void FUNC_0(AVFormatContext *VAR_0, int64_t VAR_1, int64_t VAR_2)
{ int VAR_3; MP3DecContext *mp3 = VAR_0->priv_data; int VAR_4 = mp3->usetoc == 1 && VAR_2 > 0; if (!VAR_1 &&
!(VAR_1 = avio_size(VAR_0->pb))) { av_log(VAR_0, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n"); VAR_4 = 0; } for (VAR_3 = 0; VAR_3 < XING_TOC_COUNT; VAR_3++) { uint8_t b = avio_r8(VAR_0->pb); if (VAR_4)
av_add_index_entry(VAR_0->streams[0],
av_rescale(b, VAR_1, 256),
av_rescale(VAR_3, VAR_2, XING_TOC_COUNT),
0, 0, AVINDEX_KEYFRAME); } if (VAR_4)
mp3->xing_toc = 1; }