From 1cde5efa3d6676f94dfabb9206a145e837d380ef Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 25 Jan 2006 16:47:20 +0000 Subject: [PATCH] Orange: - Missing free in AVI writing - time counter for animation render wasn't reset to zero on successive renders. --- source/blender/avi/intern/endian.c | 5 +++-- source/blender/render/intern/source/pipeline.c | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/avi/intern/endian.c b/source/blender/avi/intern/endian.c index 95492805760..152530dac0d 100644 --- a/source/blender/avi/intern/endian.c +++ b/source/blender/avi/intern/endian.c @@ -44,6 +44,7 @@ #include #include "AVI_avi.h" #include "endian.h" +#include "avi_intern.h" #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__) #define WORDS_BIGENDIAN @@ -165,7 +166,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t #ifdef WORDS_BIGENDIAN void *data; - data = malloc (size); + data = MEM_mallocN (size, "avi endian"); memcpy (data, datain, size); @@ -208,7 +209,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t break; } - free (data); + MEM_freeN (data); #else /* WORDS_BIGENDIAN */ fwrite (datain, block, size, fp); #endif /* WORDS_BIGENDIAN */ diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index baef27761ed..1cbe6273757 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -775,6 +775,9 @@ static void do_render_fields(Render *re) static void do_render_final(Render *re, Scene *scene) { + /* we set start time here, for main Blender loops */ + re->i.starttime= PIL_check_seconds_timer(); + if(re->r.scemode & R_DOSEQ) { re->result->rect32= MEM_callocN(sizeof(int)*re->rectx*re->recty, "rectot"); if(!re->test_break()) @@ -952,11 +955,15 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra) /* write movie or image */ if(BKE_imtype_is_movie(scene->r.imtype)) { + /* note; the way it gets 32 bits rects is weak... */ + int dofree=0; if(rres.rect32==NULL) { rres.rect32= MEM_mallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect"); + dofree= 1; } RE_ResultGet32(re, rres.rect32); mh->append_movie(scene->r.cfra, rres.rect32, rres.rectx, rres.recty); + if(dofree) MEM_freeN(rres.rect32); printf("Append frame %d", scene->r.cfra); } else {