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/imbuf/intern/indexer.c')
-rw-r--r--source/blender/imbuf/intern/indexer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index d79e881e5a2..e4abd8b329d 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -29,10 +29,11 @@
#include "AVI_avi.h"
#include "imbuf.h"
#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"
@@ -87,7 +88,7 @@ anim_index_builder * IMB_index_builder_create(const char * name)
BLI_make_existing_file(rv->temp_name);
- rv->fp = fopen(rv->temp_name, "w");
+ rv->fp = fopen(rv->temp_name, "wb");
if (!rv->fp) {
fprintf(stderr, "Couldn't open index target: %s! "
@@ -797,7 +798,7 @@ static int index_rebuild_ffmpeg(struct anim * anim,
while(av_read_frame(iFormatCtx, &next_packet) >= 0) {
int frame_finished = 0;
- float next_progress = ((int)floor(((double) next_packet.pos) * 100 /
+ float next_progress = (float)((int)floor(((double) next_packet.pos) * 100 /
((double) stream_size)+0.5)) / 100;
if (*progress != next_progress) {
@@ -840,8 +841,8 @@ static int index_rebuild_ffmpeg(struct anim * anim,
start_pts_set = TRUE;
}
- frameno = (pts - start_pts)
- * pts_time_base * frame_rate;
+ frameno = floor((pts - start_pts)
+ * pts_time_base * frame_rate + 0.5f);
/* decoding starts *always* on I-Frames,
so: P-Frames won't work, even if all the