Fixing [#28907] Frozen playback.
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index cafee6b49caf521e50b471368894b7c360957d54..074151c9abe52300716214735a951e6be2738c66 100644 (file)
@@ -1790,11 +1790,14 @@ void wm_event_do_handlers(bContext *C)
                                        }
                                        
                                        if(playing == 0) {
-                                               int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
-                                               if(ncfra != scene->r.cfra)      {
-                                                       scene->r.cfra = ncfra;
-                                                       ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
-                                                       WM_event_add_notifier(C, NC_WINDOW, NULL);
+                                               float time = sound_sync_scene(scene);
+                                               if(finite(time)) {
+                                                       int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
+                                                       if(ncfra != scene->r.cfra)      {
+                                                               scene->r.cfra = ncfra;
+                                                               ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
+                                                               WM_event_add_notifier(C, NC_WINDOW, NULL);
+                                                       }
                                                }
                                        }