[cvs-annodex] commit (/annodex): libannodex/trunk/src/libannodex/anx_write.c

conrad nobody at lists.annodex.net
Sun Apr 3 08:12:28 EST 2005


Update of /annodex (new revision 1205)

Modified files:
   libannodex/trunk/src/libannodex/anx_write.c

Log Message:
add a floating point tolerance to the comparison used for clip insertions.
Closes ticket:103


Modified: libannodex/trunk/src/libannodex/anx_write.c
===================================================================
--- libannodex/trunk/src/libannodex/anx_write.c	2005-04-02 04:04:00 UTC (rev 1204)
+++ libannodex/trunk/src/libannodex/anx_write.c	2005-04-02 22:12:28 UTC (rev 1205)
@@ -49,6 +49,11 @@
 /* set to 0 or 1 */
 #define FLUSH_ALWAYS 0
 
+/* Tolerance for floating point rounding errors: used for portable
+ * floating point comparisons in anx_writer_sync()
+ */
+#define TOLERANCE 0.000000000001
+
 static char * cmml_content_type = CMML_CONTENT_TYPE;
 
 typedef enum {
@@ -1196,7 +1201,7 @@
 #endif
       
       while (!made_packet &&
-	     ((current_offset > command_offset) ||
+	     ((current_offset > command_offset-TOLERANCE) ||
 	      (current_offset == 0.0 && command_offset == 0.0))) {
 
 	annodex->current_command = annodex->pending_command;


-- 
conrad



More information about the cvs-annodex mailing list