static int vorbis_decode_frame(AVCodecContext *avctx, void *data,

                               int *got_frame_ptr, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    vorbis_context *vc = avctx->priv_data;

    AVFrame *frame     = data;

    GetBitContext *gb = &vc->gb;

    float *channel_ptrs[255];

    int i, len, ret;



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



    /* get output buffer */

    frame->nb_samples = vc->blocksize[1] / 2;

    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return ret;

    }



    if (vc->audio_channels > 8) {

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

            channel_ptrs[i] = (float *)frame->extended_data[i];

    } else {

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

            int ch = ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];

            channel_ptrs[ch] = (float *)frame->extended_data[i];

        }

    }



    init_get_bits(gb, buf, buf_size*8);



    if ((len = vorbis_parse_audio_packet(vc, channel_ptrs)) <= 0)

        return len;



    if (!vc->first_frame) {

        vc->first_frame = 1;

        *got_frame_ptr = 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);



    frame->nb_samples = len;

    *got_frame_ptr    = 1;



    return buf_size;

}
static int vorbis_decode_frame(AVCodecContext *avctx, void *data,

                               int *got_frame_ptr, AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size       = avpkt->size;

    vorbis_context *vc = avctx->priv_data;

    AVFrame *frame     = data;

    GetBitContext *gb = &vc->gb;

    float *channel_ptrs[255];

    int i, len, ret;



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



    

    frame->nb_samples = vc->blocksize[1] / 2;

    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {

        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return ret;

    }



    if (vc->audio_channels > 8) {

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

            channel_ptrs[i] = (float *)frame->extended_data[i];

    } else {

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

            int ch = ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];

            channel_ptrs[ch] = (float *)frame->extended_data[i];

        }

    }



    init_get_bits(gb, buf, buf_size*8);



    if ((len = vorbis_parse_audio_packet(vc, channel_ptrs)) <= 0)

        return len;



    if (!vc->first_frame) {

        vc->first_frame = 1;

        *got_frame_ptr = 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);



    frame->nb_samples = len;

    *got_frame_ptr    = 1;



    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;

    AVFrame *frame     = VAR_1;

    GetBitContext *gb = &vc->gb;

    float *VAR_6[255];

    int VAR_7, VAR_8, VAR_9;



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



    

    frame->nb_samples = vc->blocksize[1] / 2;

    if ((VAR_9 = ff_get_buffer(VAR_0, frame, 0)) < 0) {

        av_log(VAR_0, AV_LOG_ERROR, "get_buffer() failed\n");

        return VAR_9;

    }



    if (vc->audio_channels > 8) {

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

            VAR_6[VAR_7] = (float *)frame->extended_data[VAR_7];

    } else {

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

            int ch = ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][VAR_7];

            VAR_6[ch] = (float *)frame->extended_data[VAR_7];

        }

    }



    init_get_bits(gb, VAR_4, VAR_5*8);



    if ((VAR_8 = vorbis_parse_audio_packet(vc, VAR_6)) <= 0)

        return VAR_8;



    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);



    frame->nb_samples = VAR_8;

    *VAR_2    = 1;



    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; AVFrame *frame     = VAR_1; GetBitContext *gb = &vc->gb; float *VAR_6[255]; int VAR_7, VAR_8, VAR_9; av_dlog(NULL, "packet length %d \n", VAR_5); frame->nb_samples = vc->blocksize[1] / 2; if ((VAR_9 = ff_get_buffer(VAR_0, frame, 0)) < 0) { av_log(VAR_0, AV_LOG_ERROR, "get_buffer() failed\n"); return VAR_9; } if (vc->audio_channels > 8) { for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++) VAR_6[VAR_7] = (float *)frame->extended_data[VAR_7]; } else { for (VAR_7 = 0; VAR_7 < vc->audio_channels; VAR_7++) { int ch = ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][VAR_7]; VAR_6[ch] = (float *)frame->extended_data[VAR_7]; } } init_get_bits(gb, VAR_4, VAR_5*8); if ((VAR_8 = vorbis_parse_audio_packet(vc, VAR_6)) <= 0)
return VAR_8; 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); frame->nb_samples = VAR_8; *VAR_2    = 1; return VAR_5; }