diff options
Diffstat (limited to 'libavcodec/oggvorbis.c')
-rw-r--r-- | libavcodec/oggvorbis.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 ; } |