static int qdm2_decode_frame(AVCodecContext *avctx,

            void *data, int *data_size,

            uint8_t *buf, int buf_size)

{

    QDM2Context *s = avctx->priv_data;



    if((buf == NULL) || (buf_size < s->checksum_size))

        return 0;



    *data_size = s->channels * s->frame_size * sizeof(int16_t);



    av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       buf_size, buf, s->checksum_size, data, *data_size);



    qdm2_decode(s, buf, data);



    // reading only when next superblock found

    if (s->sub_packet == 0) {

        return s->checksum_size;

    }



    return 0;

}

static int qdm2_decode_frame(AVCodecContext *avctx,

            void *data, int *data_size,

            uint8_t *buf, int buf_size)

{

    QDM2Context *s = avctx->priv_data;



    if((buf == NULL) || (buf_size < s->checksum_size))

        return 0;



    *data_size = s->channels * s->frame_size * sizeof(int16_t);



    av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       buf_size, buf, s->checksum_size, data, *data_size);



    qdm2_decode(s, buf, data);



    

    if (s->sub_packet == 0) {

        return s->checksum_size;

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0,

            void *VAR_1, int *VAR_2,

            uint8_t *VAR_3, int VAR_4)

{

    QDM2Context *s = VAR_0->priv_data;



    if((VAR_3 == NULL) || (VAR_4 < s->checksum_size))

        return 0;



    *VAR_2 = s->channels * s->frame_size * sizeof(int16_t);



    av_log(VAR_0, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       VAR_4, VAR_3, s->checksum_size, VAR_1, *VAR_2);



    qdm2_decode(s, VAR_3, VAR_1);



    

    if (s->sub_packet == 0) {

        return s->checksum_size;

    }



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
uint8_t *VAR_3, int VAR_4)
{ QDM2Context *s = VAR_0->priv_data; if((VAR_3 == NULL) || (VAR_4 < s->checksum_size))
return 0; *VAR_2 = s->channels * s->frame_size * sizeof(int16_t); av_log(VAR_0, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",
VAR_4, VAR_3, s->checksum_size, VAR_1, *VAR_2); qdm2_decode(s, VAR_3, VAR_1); if (s->sub_packet == 0) { return s->checksum_size; } return 0; }