Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/avi/intern/avi.c')
-rw-r--r--source/blender/avi/intern/avi.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index d6301b723a7..1b1ec1c08af 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -38,12 +38,15 @@
#include <stdio.h>
#include <ctype.h>
+#ifdef WIN32
+#include "BLI_winstuff.h"
+#endif
+
#include "MEM_guardedalloc.h"
#include "MEM_sys_types.h"
-#ifdef WIN32
-# include "BLI_winstuff.h"
-#endif
+#include "BLI_utildefines.h"
+#include "BLI_fileops.h"
#include "AVI_avi.h"
#include "avi_intern.h"
@@ -208,7 +211,7 @@ int AVI_is_avi(char *name)
FILE *fp;
int ret;
- fp = fopen(name, "rb");
+ fp = BLI_fopen(name, "rb");
if (fp == NULL)
return 0;
@@ -238,7 +241,7 @@ int AVI_is_avi(const char *name)
DEBUG_PRINT("opening movie\n");
movie.type = AVI_MOVIE_READ;
- movie.fp = fopen(name, "rb");
+ movie.fp = BLI_fopen(name, "rb");
movie.offset_table = NULL;
if (movie.fp == NULL)
@@ -404,7 +407,9 @@ int AVI_is_avi(const char *name)
}
if (j > 0) fseek(movie.fp, j, SEEK_CUR);
}
- else fseek(movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
+ else {
+ fseek(movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
+ }
/* Walk to the next LIST */
while (GET_FCC(movie.fp) != FCC("LIST")) {
@@ -439,7 +444,7 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
memset(movie, 0, sizeof(AviMovie));
movie->type = AVI_MOVIE_READ;
- movie->fp = fopen(name, "rb");
+ movie->fp = BLI_fopen(name, "rb");
movie->offset_table = NULL;
if (movie->fp == NULL)
@@ -595,8 +600,10 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
}
if (j > 0) fseek(movie->fp, j, SEEK_CUR);
}
- else fseek(movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
-
+ else {
+ fseek(movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
+ }
+
/* Walk to the next LIST */
while (GET_FCC(movie->fp) != FCC("LIST")) {
temp = GET_FCC(movie->fp);
@@ -761,7 +768,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
int64_t junk_pos;
movie->type = AVI_MOVIE_WRITE;
- movie->fp = fopen(name, "wb");
+ movie->fp = BLI_fopen(name, "wb");
movie->index_entries = 0;
@@ -950,7 +957,6 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
{
AviList list;
AviChunk chunk;
- AviIndexEntry *temp;
va_list ap;
int stream;
int64_t rec_off;
@@ -965,15 +971,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
if (frame_num + 1 > movie->index_entries) {
const size_t entry_size = (movie->header->Streams + 1) * sizeof(AviIndexEntry);
-
- if (movie->entries != NULL) {
- temp = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
- }
- else {
- temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");
- }
-
- movie->entries = temp;
+ movie->entries = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
movie->index_entries = frame_num + 1;
}