int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
{
    uint8_t *header_start[3];
    int header_len[3];
    int ret;

    s->avctx = avctx;
    s->extradata_parsed = 1;

    if ((ret = avpriv_split_xiph_headers(avctx->extradata,
                                         avctx->extradata_size, 30,
                                         header_start, header_len)) < 0) {
        av_log(avctx, AV_LOG_ERROR, "Extradata corrupt.\n");
        return ret;
    }

    if ((ret = parse_id_header(avctx, s, header_start[0], header_len[0])) < 0)
        return ret;

    if ((ret = parse_setup_header(avctx, s, header_start[2], header_len[2])) < 0)
        return ret;

    s->valid_extradata = 1;
    s->previous_blocksize = s->blocksize[s->mode_blocksize[0]];

    return 0;
}