[xiph-commits] r16480 - trunk/theora/examples

arek at svn.xiph.org arek at svn.xiph.org
Thu Aug 13 08:03:33 PDT 2009


Author: arek
Date: 2009-08-13 08:03:32 -0700 (Thu, 13 Aug 2009)
New Revision: 16480

Modified:
   trunk/theora/examples/encoder_example.c
Log:
Don't free not inited vorbis structures if only doing the first scanning pass.

Modified: trunk/theora/examples/encoder_example.c
===================================================================
--- trunk/theora/examples/encoder_example.c	2009-08-13 06:13:46 UTC (rev 16479)
+++ trunk/theora/examples/encoder_example.c	2009-08-13 15:03:32 UTC (rev 16480)
@@ -1473,11 +1473,11 @@
 
   /* Set up Ogg output stream */
   srand(time(NULL));
-  if(audio)ogg_stream_init(&vo,rand());
   ogg_stream_init(&to,rand()); /* oops, add one ot the above */
 
   /* initialize Vorbis assuming we have audio to compress. */
   if(audio && twopass!=1){
+    ogg_stream_init(&vo,rand());
     vorbis_info_init(&vi);
     if(audio_q>-99)
       ret = vorbis_encode_init_vbr(&vi,audio_ch,audio_hz,audio_q);
@@ -1801,7 +1801,7 @@
   }
 
   /* clear out state */
-  if(audio){
+  if(audio && twopass!=1){
     ogg_stream_clear(&vo);
     vorbis_block_clear(&vb);
     vorbis_dsp_clear(&vd);



More information about the commits mailing list