- Missing free in AVI writing
- time counter for animation render wasn't reset to zero on successive
  renders.
This commit is contained in:
Ton Roosendaal 2006-01-25 16:47:20 +00:00
parent 9da8961513
commit 1cde5efa3d
2 changed files with 10 additions and 2 deletions

@ -44,6 +44,7 @@
#include <stdio.h> #include <stdio.h>
#include "AVI_avi.h" #include "AVI_avi.h"
#include "endian.h" #include "endian.h"
#include "avi_intern.h"
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__) #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
#define WORDS_BIGENDIAN #define WORDS_BIGENDIAN
@ -165,7 +166,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
void *data; void *data;
data = malloc (size); data = MEM_mallocN (size, "avi endian");
memcpy (data, datain, size); memcpy (data, datain, size);
@ -208,7 +209,7 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
break; break;
} }
free (data); MEM_freeN (data);
#else /* WORDS_BIGENDIAN */ #else /* WORDS_BIGENDIAN */
fwrite (datain, block, size, fp); fwrite (datain, block, size, fp);
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */

@ -775,6 +775,9 @@ static void do_render_fields(Render *re)
static void do_render_final(Render *re, Scene *scene) 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) { if(re->r.scemode & R_DOSEQ) {
re->result->rect32= MEM_callocN(sizeof(int)*re->rectx*re->recty, "rectot"); re->result->rect32= MEM_callocN(sizeof(int)*re->rectx*re->recty, "rectot");
if(!re->test_break()) if(!re->test_break())
@ -952,11 +955,15 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
/* write movie or image */ /* write movie or image */
if(BKE_imtype_is_movie(scene->r.imtype)) { 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) { if(rres.rect32==NULL) {
rres.rect32= MEM_mallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect"); rres.rect32= MEM_mallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect");
dofree= 1;
} }
RE_ResultGet32(re, rres.rect32); RE_ResultGet32(re, rres.rect32);
mh->append_movie(scene->r.cfra, rres.rect32, rres.rectx, rres.recty); 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); printf("Append frame %d", scene->r.cfra);
} }
else { else {