[xiph-commits] r15871 - trunk/theora/tests

giles at svn.xiph.org giles at svn.xiph.org
Fri Mar 27 20:54:45 PDT 2009


Author: giles
Date: 2009-03-27 20:54:45 -0700 (Fri, 27 Mar 2009)
New Revision: 15871

Modified:
   trunk/theora/tests/granulepos.c
Log:
Check the return value of theora_encode_packetout() when testing the 
granulepos generation.

Corresponds to c15680 of the thusnelda branch.


Modified: trunk/theora/tests/granulepos.c
===================================================================
--- trunk/theora/tests/granulepos.c	2009-03-28 03:27:03 UTC (rev 15870)
+++ trunk/theora/tests/granulepos.c	2009-03-28 03:54:45 UTC (rev 15871)
@@ -94,7 +94,11 @@
       printf("th_encode_ycbcr_in() returned %d\n", result);
       FAIL ("negative error code submitting frame for compression");
     }
-    th_encode_packetout (te, frame >= frequency * 2, &op);
+    result = theora_encode_packetout (&th, frame >= frequency * 2, &op);
+    if (result <= 0) {
+      printf("theora_encode_packetout() returned %d\n", result);
+      FAIL("failed to retrieve compressed frame");
+    }
     if ((long long int)op.granulepos < last_granule)
       FAIL ("encoder returned a decreasing granulepos value");
     last_granule = op.granulepos;
@@ -103,7 +107,7 @@
     tframe = th_granule_frame (te, op.granulepos);
     ttime = th_granule_time(te, op.granulepos);
 #if DEBUG
-    printf("++ frame %d granulepos %lld %d:%d %d %.3lfs\n", 
+    printf("++ frame %d granulepos %lld %d:%d %d %.3lfs\n",
 	frame, (long long int)op.granulepos, keyframe, keydist,
 	tframe, th_granule_time (te, op.granulepos));
 #endif



More information about the commits mailing list