[Bf-blender-cvs] [7b7eac9] master: Add profiling prints for audio synch to detect how continuous our frame progression is
Antony Riakiotakis
noreply at git.blender.org
Fri Mar 27 15:00:34 CET 2015
Commit: 7b7eac921102414f1a9afbb04c79a3386b5cd805
Author: Antony Riakiotakis
Date: Fri Mar 27 15:00:01 2015 +0100
Branches: master
https://developer.blender.org/rB7b7eac921102414f1a9afbb04c79a3386b5cd805
Add profiling prints for audio synch to detect how continuous our frame
progression is
===================================================================
M source/blender/editors/screen/screen_ops.c
===================================================================
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 686f601..a192a50 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3413,10 +3413,17 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws)
return 0;
}
+//#define PROFILE_AUDIO_SYNCH
+
static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
bScreen *screen = CTX_wm_screen(C);
+#ifdef PROFILE_AUDIO_SYNCH
+ static int old_frame = 0;
+ int newfra_int;
+#endif
+
if (screen->animtimer && screen->animtimer == event->customdata) {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
@@ -3438,11 +3445,24 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
finite(time = BKE_sound_sync_scene(scene)))
{
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;
+
+#ifdef PROFILE_AUDIO_SYNCH
+ newfra_int = scene->r.cfra;
+ if (newfra_int < old_frame) {
+ printf("back jump detected, frame %d!\n", newfra_int);
+ }
+ else if (newfra_int > old_frame + 1) {
+ printf("forward jump detected, frame %d!\n", newfra_int);
+ }
+ fflush(stdout);
+ old_frame = newfra_int;
+#endif
}
else {
if (sync) {
More information about the Bf-blender-cvs
mailing list