diff libvorbis.c @ 11827:e778b61f86f2 libavcodec

libvorbis: Hook up min/max bitrate
author conrad
date Fri, 04 Jun 2010 22:40:31 +0000
parents 7dd2a45249a9
children 474766be9e4d
line wrap: on
line diff
--- a/libvorbis.c	Fri Jun 04 04:46:26 2010 +0000
+++ b/libvorbis.c	Fri Jun 04 22:40:31 2010 +0000
@@ -60,9 +60,12 @@
                 avccontext->global_quality / (float)FF_QP2LAMBDA / 10.0))
             return -1;
     } else {
+        int minrate = avccontext->rc_min_rate > 0 ? avccontext->rc_min_rate : -1;
+        int maxrate = avccontext->rc_min_rate > 0 ? avccontext->rc_max_rate : -1;
+
         /* constant bitrate */
         if(vorbis_encode_setup_managed(vi, avccontext->channels,
-                avccontext->sample_rate, -1, avccontext->bit_rate, -1))
+                avccontext->sample_rate, minrate, avccontext->bit_rate, maxrate))
             return -1;
 
 #ifdef OGGVORBIS_VBR_BY_ESTIMATE