summaryrefslogtreecommitdiff
path: root/libavcodec/oggvorbis.c
diff options
context:
space:
mode:
authorJustin Ruggles <jruggle@earthlink.net>2005-09-02 11:08:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-09-02 11:08:49 +0000
commit1ff8f2b36adcc0c0b3dd21f2de8886244a9d8675 (patch)
tree3b41f0ea21f1e91c251cd6e92e642c214e470d46 /libavcodec/oggvorbis.c
parent4325ffd0a260476dec22d8b246e9473d7d0f0727 (diff)
fixed quality / vbr encoding patch by (Justin Ruggles, jruggle, earthlink net)
Originally committed as revision 4546 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/oggvorbis.c')
-rw-r--r--libavcodec/oggvorbis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/oggvorbis.c b/libavcodec/oggvorbis.c
index dc7a8c6ed3..c762e4c28d 100644
--- a/libavcodec/oggvorbis.c
+++ b/libavcodec/oggvorbis.c
@@ -30,6 +30,11 @@ typedef struct OggVorbisContext {
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 @@ static int oggvorbis_encode_init(AVCodecContext *avccontext) {
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;