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

tterribe at svn.xiph.org tterribe at svn.xiph.org
Tue Jul 21 17:34:58 PDT 2009


Author: tterribe
Date: 2009-07-21 17:34:58 -0700 (Tue, 21 Jul 2009)
New Revision: 16310

Modified:
   branches/theora-thusnelda/lib/enc/encapiwrapper.c
Log:
Add support for non-power-of-2 keyframe intervals to the 1.0 API wrapper.


Modified: branches/theora-thusnelda/lib/enc/encapiwrapper.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encapiwrapper.c	2009-07-22 00:33:59 UTC (rev 16309)
+++ branches/theora-thusnelda/lib/enc/encapiwrapper.c	2009-07-22 00:34:58 UTC (rev 16310)
@@ -42,6 +42,7 @@
 int theora_encode_init(theora_state *_te,theora_info *_ci){
   th_api_info *apiinfo;
   th_info      info;
+  ogg_uint32_t keyframe_frequency_force;
   /*Allocate our own combined API wrapper/theora_info struct.
     We put them both in one malloc'd block so that when the API wrapper is
      freed, the info struct goes with it.
@@ -64,6 +65,12 @@
   _te->granulepos=0;
   _te->i=&apiinfo->info;
   _te->i->codec_setup=&apiinfo->api;
+  /*Set the precise requested keyframe frequency.*/
+  keyframe_frequency_force=_ci->keyframe_auto_p?
+   _ci->keyframe_frequency_force:_ci->keyframe_frequency;
+  th_encode_ctl(apiinfo->api.encode,
+   TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
+   &keyframe_frequency_force,sizeof(keyframe_frequency_force));
   /*TODO: Additional codec setup using the extra fields in theora_info.*/
   return 0;
 }



More information about the commits mailing list