[xiph-commits] r16118 - branches/theora-thusnelda/lib/enc

tterribe at svn.xiph.org tterribe at svn.xiph.org
Sat Jun 13 23:56:15 PDT 2009


Author: tterribe
Date: 2009-06-13 23:56:14 -0700 (Sat, 13 Jun 2009)
New Revision: 16118

Modified:
   branches/theora-thusnelda/lib/enc/encode.c
Log:
Force library version number in encoder init.


Modified: branches/theora-thusnelda/lib/enc/encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encode.c	2009-06-14 06:45:44 UTC (rev 16117)
+++ branches/theora-thusnelda/lib/enc/encode.c	2009-06-14 06:56:14 UTC (rev 16118)
@@ -861,14 +861,20 @@
 }
 
 static int oc_enc_init(oc_enc_ctx *_enc,const th_info *_info){
-  int ret;
-  int pli;
+  th_info info;
+  int     ret;
+  int     pli;
+  /*Clean up the requested settings.*/
+  memcpy(&info,_info,sizeof(info));
+  info.version_major=TH_VERSION_MAJOR;
+  info.version_minor=TH_VERSION_MINOR;
+  info.version_subminor=TH_VERSION_SUB;
+  if(info.quality>63)info.quality=63;
+  if(info.quality<0)info.quality=32;
+  if(info.target_bitrate<0)info.target_bitrate=0;
   /*Initialize the shared encoder/decoder state.*/
-  ret=oc_state_init(&_enc->state,_info,4);
+  ret=oc_state_init(&_enc->state,&info,4);
   if(ret<0)return ret;
-  if(_enc->state.info.quality>63)_enc->state.info.quality=63;
-  if(_enc->state.info.quality<0)_enc->state.info.quality=32;
-  if(_enc->state.info.target_bitrate<0)_enc->state.info.target_bitrate=0;
   _enc->mb_info=_ogg_calloc(_enc->state.nmbs,sizeof(*_enc->mb_info));
   _enc->frag_dc=_ogg_calloc(_enc->state.nfrags,sizeof(*_enc->frag_dc));
   _enc->coded_mbis=



More information about the commits mailing list