static int vorbis_decode_frame(AVCodecContext *avccontext,

                               void *data, int *data_size,

                               AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    vorbis_context *vc = avccontext->priv_data ;

    GetBitContext *gb = &(vc->gb);

    const float *channel_ptrs[255];

    int i, len;



    if (!buf_size)

        return 0;



    av_dlog(NULL, "packet length %d \n", buf_size);



    init_get_bits(gb, buf, buf_size*8);



    len = vorbis_parse_audio_packet(vc);



    if (len <= 0) {

        *data_size = 0;

        return buf_size;

    }



    if (!vc->first_frame) {

        vc->first_frame = 1;

        *data_size = 0;

        return buf_size ;

    }



    av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",

            get_bits_count(gb) / 8, get_bits_count(gb) % 8, len);



    if (vc->audio_channels > 8) {

        for (i = 0; i < vc->audio_channels; i++)

            channel_ptrs[i] = vc->channel_floors + i * len;

    } else {

        for (i = 0; i < vc->audio_channels; i++)

            channel_ptrs[i] = vc->channel_floors +

                              len * ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];

    }



    if (avccontext->sample_fmt == AV_SAMPLE_FMT_FLT)

        vc->fmt_conv.float_interleave(data, channel_ptrs, len, vc->audio_channels);

    else

        vc->fmt_conv.float_to_int16_interleave(data, channel_ptrs, len,

                                               vc->audio_channels);



    *data_size = len * vc->audio_channels *

                 av_get_bytes_per_sample(avccontext->sample_fmt);



    return buf_size ;

}

static int vorbis_decode_frame(AVCodecContext *avccontext,

                               void *data, int *data_size,

                               AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    vorbis_context *vc = avccontext->priv_data ;

    GetBitContext *gb = &(vc->gb);

    const float *channel_ptrs[255];

    int i, len;



    if (!buf_size)

        return 0;



    av_dlog(NULL, "packet length %d \n", buf_size);



    init_get_bits(gb, buf, buf_size*8);



    len = vorbis_parse_audio_packet(vc);



    if (len <= 0) {

        *data_size = 0;

        return buf_size;

    }



    if (!vc->first_frame) {

        vc->first_frame = 1;

        *data_size = 0;

        return buf_size ;

    }



    av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",

            get_bits_count(gb) / 8, get_bits_count(gb) % 8, len);



    if (vc->audio_channels > 8) {

        for (i = 0; i < vc->audio_channels; i++)

            channel_ptrs[i] = vc->channel_floors + i * len;

    } else {

        for (i = 0; i < vc->audio_channels; i++)

            channel_ptrs[i] = vc->channel_floors +

                              len * ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];

    }



    if (avccontext->sample_fmt == AV_SAMPLE_FMT_FLT)

        vc->fmt_conv.float_interleave(data, channel_ptrs, len, vc->audio_channels);

    else

        vc->fmt_conv.float_to_int16_interleave(data, channel_ptrs, len,

                                               vc->audio_channels);



    *data_size = len * vc->audio_channels *

                 av_get_bytes_per_sample(avccontext->sample_fmt);



    return buf_size ;

}

static int FUNC_0(AVCodecContext *VAR_0,

                               void *VAR_1, int *VAR_2,

                               AVPacket *VAR_3)

{

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5       = VAR_3->size;

    vorbis_context *vc = VAR_0->priv_data ;

    GetBitContext *gb = &(vc->gb);

    const float *VAR_6[255];

    int VAR_7, VAR_8;



    if (!VAR_5)

        return 0;



    av_dlog(NULL, "packet length %d \n", VAR_5);



    init_get_bits(gb, VAR_4, VAR_5*8);



    VAR_8 = vorbis_parse_audio_packet(vc);



    if (VAR_8 <= 0) {

        *VAR_2 = 0;

        return VAR_5;

    }



    if (!vc->first_frame) {

        vc->first_frame = 1;

        *VAR_2 = 0;

        return VAR_5 ;

    }



    av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",

            get_bits_count(gb) / 8, get_bits_count(gb) % 8, VAR_8);



    if (vc->audio_channels > 8) {

        for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++)

            VAR_6[VAR_7] = vc->channel_floors + VAR_7 * VAR_8;

    } else {

        for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++)

            VAR_6[VAR_7] = vc->channel_floors +

                              VAR_8 * ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][VAR_7];

    }



    if (VAR_0->sample_fmt == AV_SAMPLE_FMT_FLT)

        vc->fmt_conv.float_interleave(VAR_1, VAR_6, VAR_8, vc->audio_channels);

    else

        vc->fmt_conv.float_to_int16_interleave(VAR_1, VAR_6, VAR_8,

                                               vc->audio_channels);



    *VAR_2 = VAR_8 * vc->audio_channels *

                 av_get_bytes_per_sample(VAR_0->sample_fmt);



    return VAR_5 ;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
AVPacket *VAR_3)
{ const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5       = VAR_3->size; vorbis_context *vc = VAR_0->priv_data ; GetBitContext *gb = &(vc->gb); const float *VAR_6[255]; int VAR_7, VAR_8; if (!VAR_5)
return 0; av_dlog(NULL, "packet length %d \n", VAR_5); init_get_bits(gb, VAR_4, VAR_5*8); VAR_8 = vorbis_parse_audio_packet(vc); if (VAR_8 <= 0) { *VAR_2 = 0; return VAR_5; } if (!vc->first_frame) { vc->first_frame = 1; *VAR_2 = 0; return VAR_5 ; } av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",
get_bits_count(gb) / 8, get_bits_count(gb) % 8, VAR_8); if (vc->audio_channels > 8) { for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++) VAR_6[VAR_7] = vc->channel_floors + VAR_7 * VAR_8; } else { for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++) VAR_6[VAR_7] = vc->channel_floors +
VAR_8 * ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][VAR_7]; } if (VAR_0->sample_fmt == AV_SAMPLE_FMT_FLT)
vc->fmt_conv.float_interleave(VAR_1, VAR_6, VAR_8, vc->audio_channels); else
vc->fmt_conv.float_to_int16_interleave(VAR_1, VAR_6, VAR_8,
vc->audio_channels); *VAR_2 = VAR_8 * vc->audio_channels *
av_get_bytes_per_sample(VAR_0->sample_fmt); return VAR_5 ; }