From 492cd3a9203779380cea24f23190b92af2b48007 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 9 Dec 2002 12:03:43 +0000 Subject: AVVideoFrame -> AVFrame Originally committed as revision 1327 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/oggvorbis.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libavcodec/oggvorbis.c') diff --git a/libavcodec/oggvorbis.c b/libavcodec/oggvorbis.c index 1d046a3bb2..e327e2fd3e 100644 --- a/libavcodec/oggvorbis.c +++ b/libavcodec/oggvorbis.c @@ -24,9 +24,9 @@ typedef struct OggVorbisContext { int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) { - if(avccontext->quality) /* VBR requested */ + if(avccontext->coded_frame->quality) /* VBR requested */ return vorbis_encode_init_vbr(vi, avccontext->channels, - avccontext->sample_rate, (float)avccontext->quality / 1000) ; + avccontext->sample_rate, (float)avccontext->coded_frame->quality / 1000) ; return vorbis_encode_init(vi, avccontext->channels, avccontext->sample_rate, -1, avccontext->bit_rate, -1) ; @@ -45,6 +45,9 @@ static int oggvorbis_encode_init(AVCodecContext *avccontext) { vorbis_block_init(&context->vd, &context->vb) ; avccontext->frame_size = OGGVORBIS_FRAME_SIZE ; + + avccontext->coded_frame= avcodec_alloc_frame(); + avccontext->coded_frame->key_frame= 1; return 0 ; } @@ -113,6 +116,8 @@ static int oggvorbis_encode_close(AVCodecContext *avccontext) { vorbis_block_clear(&context->vb); vorbis_dsp_clear(&context->vd); vorbis_info_clear(&context->vi); + + av_freep(&avccontext->coded_frame); return 0 ; } -- cgit v1.2.3