ast->codec.codec_type = CODEC_TYPE_AUDIO ; ast->codec.codec_id = CODEC_ID_VORBIS ;
codec= &ast->codec; codec->codec_type = CODEC_TYPE_AUDIO; codec->codec_id = CODEC_ID_VORBIS; for(i=0; i<3; i++){ if(next_packet(avfcontext, &op)){ return -1; } codec->extradata_size+= 2 + op.bytes; codec->extradata= av_realloc(codec->extradata, codec->extradata_size); p= codec->extradata + codec->extradata_size - 2 - op.bytes; *(p++)= op.bytes>>8; *(p++)= op.bytes&0xFF; memcpy(p, op.packet, op.bytes); }
static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap){    OggContext *context = avfcontext->priv_data;    char *buf ;    ogg_page og ;    AVStream *ast ;         avfcontext->ctx_flags |= AVFMTCTX_NOHEADER;         ogg_sync_init(&context->oy) ;    buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;    if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)	return -EIO ;        ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;       ogg_sync_pageout(&context->oy, &og) ;    ogg_stream_init(&context->os, ogg_page_serialno(&og)) ;    ogg_stream_pagein(&context->os, &og) ;      /* currently only one vorbis stream supported */    ast = av_new_stream(avfcontext, 0) ;    if(!ast)	return AVERROR_NOMEM ;    ast->codec.codec_type = CODEC_TYPE_AUDIO ;    ast->codec.codec_id = CODEC_ID_VORBIS ;        return 0 ;}