Commit: 363a044b4c8223cb7bace020e31a3f2f7e3475a6
Author: Antony Riakiotakis
Date:   Wed Feb 4 20:38:31 2015 +0100
Branches: master
https://developer.blender.org/rB363a044b4c8223cb7bace020e31a3f2f7e3475a6

Sequencer, scaling and audio synch

Don't scale proxies, same as we do in gooseberry, also for sound synch
give a small window around sound where frame is just pushed forward.
Avoids video jumping in the cases when video renders faster than sound
(yes, weirdly enough it happens sometimes). There might be a few jumps
but results looks smoother here.

===================================================================

M       source/blender/blenkernel/intern/sequencer.c
M       source/blender/editors/screen/screen_ops.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 83287fe..7a284a8 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2137,12 +2137,14 @@ static ImBuf *input_preprocess(const SeqRenderData 
*context, Sequence *seq, floa
                multibuf(ibuf, mul);
        }
 
-       if (ibuf->x != context->rectx || ibuf->y != context->recty) {
-               if (scene->r.mode & R_OSA) {
-                       IMB_scaleImBuf(ibuf, (short)context->rectx, 
(short)context->recty);
-               }
-               else {
-                       IMB_scalefastImBuf(ibuf, (short)context->rectx, 
(short)context->recty);
+       if (!is_proxy_image) {
+               if (ibuf->x != context->rectx || ibuf->y != context->recty) {
+                       if (scene->r.mode & R_OSA) {
+                               IMB_scaleImBuf(ibuf, (short)context->rectx, 
(short)context->recty);
+                       }
+                       else {
+                               IMB_scalefastImBuf(ibuf, (short)context->rectx, 
(short)context->recty);
+                       }
                }
        }
 
diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index 1990216..6b75d21 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3387,7 +3387,12 @@ static int screen_animation_step(bContext *C, wmOperator 
*UNUSED(op), const wmEv
                    (sad->flag & ANIMPLAY_FLAG_REVERSE) == false &&
                    finite(time = sound_sync_scene(scene)))
                {
-                       scene->r.cfra = (double)time * FPS + 0.5;
+                       double newfra = (double)time * FPS;
+                       /* give some space here to avoid jumps */
+                       if (newfra + 0.5 > scene->r.cfra && newfra - 0.5 < 
scene->r.cfra)
+                               scene->r.cfra++;
+                       else
+                               scene->r.cfra = newfra + 0.5;
                }
                else {
                        if (sync) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to