# HG changeset patch # User michael # Date 1125659329 0 # Node ID c553a407b1b68911eac4ffdb052c36560dd1bbd1 # Parent c4311f623fd582e2660402d8da3ee2130d333bb0 fixed quality / vbr encoding patch by (Justin Ruggles, jruggle, earthlink net) diff -r c4311f623fd5 -r c553a407b1b6 oggvorbis.c --- a/oggvorbis.c Fri Sep 02 08:30:26 2005 +0000 +++ b/oggvorbis.c Fri Sep 02 11:08:49 2005 +0000 @@ -30,6 +30,11 @@ static int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) { + if(avccontext->flags & CODEC_FLAG_QSCALE) { + return vorbis_encode_init_vbr(vi, avccontext->channels, + avccontext->sample_rate, + avccontext->global_quality / (float)FF_QP2LAMBDA); + } #ifdef OGGVORBIS_VBR_BY_ESTIMATE /* variable bitrate by estimate */ @@ -87,6 +92,8 @@ vorbis_comment_clear(&context->vc); avccontext->frame_size = OGGVORBIS_FRAME_SIZE ; + avccontext->time_base.den = avccontext->sample_rate; + avccontext->time_base.num = 1; avccontext->coded_frame= avcodec_alloc_frame(); avccontext->coded_frame->key_frame= 1;