[xiph-commits] r15680 - branches/theora-thusnelda/tests

giles at svn.xiph.org giles at svn.xiph.org
Fri Feb 6 16:38:15 PST 2009


Author: giles
Date: 2009-02-06 16:38:14 -0800 (Fri, 06 Feb 2009)
New Revision: 15680

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


Modified: branches/theora-thusnelda/tests/granulepos.c
===================================================================
--- branches/theora-thusnelda/tests/granulepos.c	2009-02-06 23:06:22 UTC (rev 15679)
+++ branches/theora-thusnelda/tests/granulepos.c	2009-02-07 00:38:14 UTC (rev 15680)
@@ -103,7 +103,11 @@
       printf("theora_encode_YUVin() returned %d\n", result);
       FAIL ("negative error code submitting frame for compression");
     }
-    theora_encode_packetout (&th, 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;
@@ -115,7 +119,7 @@
     if (tframe != frame + 1)
       FAIL ("theora_granule_frame returned incorrect results");
 #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, theora_granule_time (&th, op.granulepos));
 #endif



More information about the commits mailing list