Revision: 39195
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39195
Author:   nazgul
Date:     2011-08-08 18:44:19 +0000 (Mon, 08 Aug 2011)
Log Message:
-----------
Camera tracking integration
===========================

Just another attempt to fix compilation with msvc:
- Use BLI_snprintf instead of snprintf
- Do not use C99 rint function

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c      
2011-08-08 18:28:46 UTC (rev 39194)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c      
2011-08-08 18:44:19 UTC (rev 39195)
@@ -5,6 +5,8 @@
 #include "MEM_guardedalloc.h"
 #include "BLI_utildefines.h"
 #include "BLI_blenlib.h"
+#include "BLI_math_base.h"
+#include "BLI_string.h"
 #include "MEM_guardedalloc.h"
 #include "DNA_userdef_types.h"
 #include "BKE_global.h"
@@ -419,7 +421,7 @@
        rv->of = avformat_alloc_context();
        rv->of->oformat = av_guess_format("avi", NULL, NULL);
        
-       snprintf(rv->of->filename, sizeof(rv->of->filename), "%s", fname);
+       BLI_snprintf(rv->of->filename, sizeof(rv->of->filename), "%s", fname);
 
        fprintf(stderr, "Starting work on proxy: %s\n", rv->of->filename);
 
@@ -726,8 +728,8 @@
 
        while(av_read_frame(iFormatCtx, &next_packet) >= 0) {
                int frame_finished = 0;
-               float next_progress =  rint(((double) next_packet.pos) * 100 / 
-                                           ((double) stream_size)) / 100;
+               float next_progress =  ((int)floor(((double) next_packet.pos) * 
100 /
+                                                  ((double) stream_size)+0.5)) 
/ 100;
 
                if (*progress != next_progress) {
                        *progress = next_progress;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to