vorbis_synthesis_headerin(&context->vi, &context->vc, op) ;
if(vorbis_synthesis_headerin(&context->vi, &context->vc, op)<0){ av_log(avccontext, AV_LOG_ERROR, "%lld. vorbis header damaged\n", op->packetno+1); return -1; } avccontext->channels = context->vi.channels ; avccontext->sample_rate = context->vi.rate ;
static int oggvorbis_decode_frame(AVCodecContext *avccontext,                        void *data, int *data_size,                        uint8_t *buf, int buf_size){    OggVorbisContext *context = avccontext->priv_data ;    ogg_packet *op = (ogg_packet*)buf ;    float **pcm ;    int samples, total_samples, total_bytes ;     op->packet = (char*)op + sizeof(ogg_packet) ; /* correct data pointer */    if(op->packetno < 3) {	vorbis_synthesis_headerin(&context->vi, &context->vc, op) ;	return buf_size ;    }    if(op->packetno == 3) {	av_log(avccontext, AV_LOG_ERROR, "vorbis_decode: %d channel, %ldHz, encoder `%s'\n",		context->vi.channels, context->vi.rate, context->vc.vendor);	avccontext->channels = context->vi.channels ;	avccontext->sample_rate = context->vi.rate ;		vorbis_synthesis_init(&context->vd, &context->vi) ;	vorbis_block_init(&context->vd, &context->vb);     }    if(vorbis_synthesis(&context->vb, op) == 0)	vorbis_synthesis_blockin(&context->vd, &context->vb) ;        total_samples = 0 ;    total_bytes = 0 ;    while((samples = vorbis_synthesis_pcmout(&context->vd, &pcm)) > 0) {	conv(samples, pcm, (char*)data + total_bytes, context->vi.channels) ;	total_bytes += samples * 2 * context->vi.channels ;	total_samples += samples ;        vorbis_synthesis_read(&context->vd, samples) ;    }    *data_size = total_bytes ;       return buf_size ;}