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

                                int *got_frame_ptr, AVPacket *avpkt)

{

    FDKAACDecContext *s = avctx->priv_data;

    AVFrame *frame = data;

    int ret;

    AAC_DECODER_ERROR err;

    UINT valid = avpkt->size;



    err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);

    if (err != AAC_DEC_OK) {

        av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);

        return AVERROR_INVALIDDATA;

    }



    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0);

    if (err == AAC_DEC_NOT_ENOUGH_BITS) {

        ret = avpkt->size - valid;

        goto end;

    }

    if (err != AAC_DEC_OK) {

        av_log(avctx, AV_LOG_ERROR,

               "aacDecoder_DecodeFrame() failed: %x\n", err);

        ret = AVERROR_UNKNOWN;

        goto end;

    }



    if ((ret = get_stream_info(avctx)) < 0)

        goto end;

    frame->nb_samples = avctx->frame_size;



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

        goto end;



    memcpy(frame->extended_data[0], s->decoder_buffer,

           avctx->channels * avctx->frame_size *

           av_get_bytes_per_sample(avctx->sample_fmt));



    *got_frame_ptr = 1;

    ret = avpkt->size - valid;



end:

    return ret;

}

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

                                int *got_frame_ptr, AVPacket *avpkt)

{

    FDKAACDecContext *s = avctx->priv_data;

    AVFrame *frame = data;

    int ret;

    AAC_DECODER_ERROR err;

    UINT valid = avpkt->size;



    err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);

    if (err != AAC_DEC_OK) {

        av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);

        return AVERROR_INVALIDDATA;

    }



    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0);

    if (err == AAC_DEC_NOT_ENOUGH_BITS) {

        ret = avpkt->size - valid;

        goto end;

    }

    if (err != AAC_DEC_OK) {

        av_log(avctx, AV_LOG_ERROR,

               "aacDecoder_DecodeFrame() failed: %x\n", err);

        ret = AVERROR_UNKNOWN;

        goto end;

    }



    if ((ret = get_stream_info(avctx)) < 0)

        goto end;

    frame->nb_samples = avctx->frame_size;



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

        goto end;



    memcpy(frame->extended_data[0], s->decoder_buffer,

           avctx->channels * avctx->frame_size *

           av_get_bytes_per_sample(avctx->sample_fmt));



    *got_frame_ptr = 1;

    ret = avpkt->size - valid;



end:

    return ret;

}

    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0);
static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,

                                int *VAR_2, AVPacket *VAR_3)

{

    FDKAACDecContext *s = VAR_0->priv_data;

    AVFrame *frame = VAR_1;

    int VAR_4;

    AAC_DECODER_ERROR err;

    UINT valid = VAR_3->size;



    err = aacDecoder_Fill(s->handle, &VAR_3->VAR_1, &VAR_3->size, &valid);

    if (err != AAC_DEC_OK) {

        av_log(VAR_0, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);

        return AVERROR_INVALIDDATA;

    }



    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0);

    if (err == AAC_DEC_NOT_ENOUGH_BITS) {

        VAR_4 = VAR_3->size - valid;

        goto end;

    }

    if (err != AAC_DEC_OK) {

        av_log(VAR_0, AV_LOG_ERROR,

               "aacDecoder_DecodeFrame() failed: %x\n", err);

        VAR_4 = AVERROR_UNKNOWN;

        goto end;

    }



    if ((VAR_4 = get_stream_info(VAR_0)) < 0)

        goto end;

    frame->nb_samples = VAR_0->frame_size;



    if ((VAR_4 = ff_get_buffer(VAR_0, frame, 0)) < 0)

        goto end;



    memcpy(frame->extended_data[0], s->decoder_buffer,

           VAR_0->channels * VAR_0->frame_size *

           av_get_bytes_per_sample(VAR_0->sample_fmt));



    *VAR_2 = 1;

    VAR_4 = VAR_3->size - valid;



end:

    return VAR_4;

}

static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,
int *VAR_2, AVPacket *VAR_3)
{ FDKAACDecContext *s = VAR_0->priv_data; AVFrame *frame = VAR_1; int VAR_4; AAC_DECODER_ERROR err; UINT valid = VAR_3->size; err = aacDecoder_Fill(s->handle, &VAR_3->VAR_1, &VAR_3->size, &valid); if (err != AAC_DEC_OK) { av_log(VAR_0, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err); return AVERROR_INVALIDDATA; } err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0); if (err == AAC_DEC_NOT_ENOUGH_BITS) { VAR_4 = VAR_3->size - valid; goto end; } if (err != AAC_DEC_OK) { av_log(VAR_0, AV_LOG_ERROR,
"aacDecoder_DecodeFrame() failed: %x\n", err); VAR_4 = AVERROR_UNKNOWN; goto end; } if ((VAR_4 = get_stream_info(VAR_0)) < 0)
goto end; frame->nb_samples = VAR_0->frame_size; if ((VAR_4 = ff_get_buffer(VAR_0, frame, 0)) < 0)
goto end; memcpy(frame->extended_data[0], s->decoder_buffer,
VAR_0->channels * VAR_0->frame_size *
av_get_bytes_per_sample(VAR_0->sample_fmt)); *VAR_2 = 1; VAR_4 = VAR_3->size - valid; end:
return VAR_4; }