av_log(s->avctx, AV_LOG_DEBUG, "channels: %d\n", assignment+1);
static int decode_frame(FLACContext *s){    int blocksize_code, sample_rate_code, sample_size_code, assignment, i;        blocksize_code = get_bits(&s->gb, 4);    sample_rate_code = get_bits(&s->gb, 4);        assignment = get_bits(&s->gb, 4); /* channel assignment */    if (assignment < 8)    {        s->order = INDEPENDENT;        if (s->channels != assignment+1)            av_log(s->avctx, AV_LOG_DEBUG, "channel number and number of assigned channels differ!\n");        av_log(s->avctx, AV_LOG_DEBUG, "channels: %d\n", assignment+1);    }    else if (assignment == 8)    {        s->order = LEFT_SIDE;        av_log(s->avctx, AV_LOG_DEBUG, "left/side\n");    }    else if (assignment == 9)    {        s->order = RIGHT_SIDE;        av_log(s->avctx, AV_LOG_DEBUG, "right/side\n");    }    else if (assignment == 10)    {        s->order = MID_SIDE;        av_log(s->avctx, AV_LOG_DEBUG, "mid/side\n");    }    else    {        av_log(s->avctx, AV_LOG_DEBUG, "unsupported channel assignment\n");        return -1;    }    if ((assignment >= 8) && (s->channels != 2))    {        return -1;    }            sample_size_code = get_bits(&s->gb, 3);    if (sample_size_code != 0)        s->bps = sample_size_table[sample_size_code];    if ((sample_size_code == 3) || (sample_size_code == 7))    {        av_log(s->avctx, AV_LOG_DEBUG, "invalid sample size code (%d)\n", sample_size_code);        return -1;    }    if (get_bits1(&s->gb))    {        av_log(s->avctx, AV_LOG_DEBUG, "broken stream, invalid padding\n");//        return -1;    }        if (/*((blocksize_code == 6) || (blocksize_code == 7)) &&*/        (s->min_blocksize != s->max_blocksize)){        if(get_utf8(&s->gb) < 0){            av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");            return -1;        }    }else{        if(get_utf8(&s->gb) < 0){            av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");            return -1;        }    }    if (blocksize_code == 0)        s->blocksize = s->min_blocksize;    else if (blocksize_code == 1)        s->blocksize = 192;    else if (blocksize_code <= 5)        s->blocksize = 576 << (blocksize_code - 2);    else if (blocksize_code == 6)        s->blocksize = get_bits(&s->gb, 8)+1;    else if (blocksize_code == 7)        s->blocksize = get_bits(&s->gb, 16)+1;    else if (blocksize_code >= 8)        s->blocksize = 256 << (blocksize_code - 8);    if(s->blocksize > s->max_blocksize){        av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", s->blocksize, s->max_blocksize);        return -1;    }    if (sample_rate_code == 0){        //Streaminfo    }else if ((sample_rate_code > 3) && (sample_rate_code < 12))        s->samplerate = sample_rate_table[sample_rate_code];    else if (sample_rate_code == 12)                s->samplerate = get_bits(&s->gb, 8) * 1000;    else if (sample_rate_code == 13)                s->samplerate = get_bits(&s->gb, 16);    else if (sample_rate_code == 14)                s->samplerate = get_bits(&s->gb, 16) * 10;    else{        av_log(s->avctx, AV_LOG_ERROR, "illegal sample rate code %d\n", sample_rate_code);        return -1;    }    skip_bits(&s->gb, 8); /* header crc *///    dump_headers(s);    /* subframes */    for (i = 0; i < s->channels; i++)    {/*        if (s->blocksize != s->last_blocksize)        {            s->decoded[i] = av_realloc(s->decoded[i], sizeof(uint32_t)*s->blocksize);        }*///        av_log(s->avctx, AV_LOG_DEBUG, "decoded: %x residual: %x\n", s->decoded[i], s->residual[i]);        if (decode_subframe(s, i) < 0)            return -1;    }        align_get_bits(&s->gb);    /* frame footer */    skip_bits(&s->gb, 16); /* data crc */    return 0;}