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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-13 13:20:13 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-13 13:20:13 +0400
commit74aede4d71aff4795178885ad5b82d4bfddadcb1 (patch)
tree6401932769ce1e62786003d0a7806b8b0e311586 /source/blender/blenkernel/intern/writeavi.c
parent14e75b6c8483725a331123298309a940efa2a31f (diff)
Fix #29824: Error writing frame if 3D scene starts after first frame of animation and output is H264
Issue was caused by incorrectly set PTS value frames came form Scene strip renderer. This value used to be calculated from RenderData current and start frame which lead to non-uniformuly counting which totally confuses encoder. Switch append_avi and append_ffmpeg to use current frame from rendering scene (which was already passing to this functions and was used mostly for logging) and start frame of rendering scene (it's new parameter added). This allowed to calculate correct PTS value easily and get rid of global static sframe variable in writeavi.c file.
Diffstat (limited to 'source/blender/blenkernel/intern/writeavi.c')
-rw-r--r--source/blender/blenkernel/intern/writeavi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index da64c464dce..dbb37ad9c1d 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -52,7 +52,8 @@
/* callbacks */
static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports);
static void end_avi(void);
-static int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports);
+static int append_avi(RenderData *rd, int start_frame, int frame, int *pixels,
+ int rectx, int recty, ReportList *reports);
static void filepath_avi(char *string, RenderData *rd);
/* ********************** general blender movie support ***************************** */
@@ -121,7 +122,6 @@ bMovieHandle *BKE_get_movie_handle(const char imtype)
static AviMovie *avi=NULL;
-static int sframe;
static void filepath_avi (char *string, RenderData *rd)
{
@@ -150,7 +150,6 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
filepath_avi(name, rd);
- sframe = (rd->sfra);
x = rectx;
y = recty;
@@ -183,7 +182,8 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
return 1;
}
-static int append_avi(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, int recty, ReportList *UNUSED(reports))
+static int append_avi(RenderData *UNUSED(rd), int start_frame, int frame, int *pixels,
+ int rectx, int recty, ReportList *UNUSED(reports))
{
unsigned int *rt1, *rt2, *rectot;
int x, y;
@@ -212,8 +212,8 @@ static int append_avi(RenderData *UNUSED(rd), int frame, int *pixels, int rectx,
}
}
- AVI_write_frame (avi, (frame-sframe), AVI_FORMAT_RGB32, rectot, rectx*recty*4);
-// printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe);
+ AVI_write_frame (avi, (frame-start_frame), AVI_FORMAT_RGB32, rectot, rectx*recty*4);
+// printf ("added frame %3d (frame %3d in avi): ", frame, frame-start_frame);
return 1;
}