[xiph-commits] r7451 - trunk/vorbis/lib

xiphmont at motherfish-iii.xiph.org xiphmont
Thu Aug 5 19:06:56 PDT 2004


Author: xiphmont
Date: Thu Aug  5 19:06:56 2004
New Revision: 7451

Modified:
trunk/vorbis/lib/vorbisenc.c
Log:
Correct a bug unnoticed until documenting; the 'window' field in the
vorbis_info struct should be the size of the bitrate reservoir in
seconds.



Modified: trunk/vorbis/lib/vorbisenc.c
===================================================================
--- trunk/vorbis/lib/vorbisenc.c	2004-08-02 06:59:25 UTC (rev 7450)
+++ trunk/vorbis/lib/vorbisenc.c	2004-08-02 08:04:52 UTC (rev 7451)
@@ -11,7 +11,7 @@
********************************************************************

function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.50 2003/12/30 12:44:28 xiphmont Exp $
+ last mod: $Id$

********************************************************************/

@@ -824,10 +824,18 @@
vorbis_encode_map_n_res_setup(vi,hi->base_setting,setup->maps);

/* set bitrate readonlies and management */
-  vi->bitrate_nominal=setting_to_approx_bitrate(vi);
+  if(hi->bitrate_av>0)
+    vi->bitrate_nominal=hi->bitrate_av;
+  else{
+    vi->bitrate_nominal=setting_to_approx_bitrate(vi);
+  }
+
vi->bitrate_lower=hi->bitrate_min;
vi->bitrate_upper=hi->bitrate_max;
-  vi->bitrate_window=(double)hi->bitrate_reservoir/vi->rate;
+  if(hi->bitrate_av)
+    vi->bitrate_window=(double)hi->bitrate_reservoir/hi->bitrate_av;
+  else
+    vi->bitrate_window=0.;

if(hi->managed){
ci->bi.avg_rate=hi->bitrate_av;



More information about the commits mailing list