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:
authorCampbell Barton <ideasman42@gmail.com>2012-09-27 06:18:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-27 06:18:14 +0400
commitc5baae40f7b097c45cfea7a4580db5d8dccb65c8 (patch)
treec61c8e55b567db3d514a0a60ebdeef7146d5c1e4 /source/blender/windowmanager/intern
parent7b31b442417eabfde6373b68090cebdc2bf1de0e (diff)
wm_event_do_handlers was calling sound_sync_scene() twice without error checking the result of the second call.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index c05d9532f74..13daddeb399 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2021,23 +2021,26 @@ void wm_event_do_handlers(bContext *C)
Scene *scene = win->screen->scene;
if (scene) {
- int playing = sound_scene_playing(win->screen->scene);
+ int is_playing_sound = sound_scene_playing(win->screen->scene);
- if (playing != -1) {
+ if (is_playing_sound != -1) {
+ int is_playing_screen;
CTX_wm_window_set(C, win);
CTX_wm_screen_set(C, win->screen);
CTX_data_scene_set(C, scene);
- if (((playing == 1) && (!ED_screen_animation_playing(wm))) ||
- ((playing == 0) && (ED_screen_animation_playing(wm))))
+ is_playing_screen = (ED_screen_animation_playing(wm) != NULL);
+
+ if (((is_playing_sound == 1) && (is_playing_screen == 0)) ||
+ ((is_playing_sound == 0) && (is_playing_screen == 1)))
{
ED_screen_animation_play(C, -1, 1);
}
- if (playing == 0) {
- float time = sound_sync_scene(scene);
+ if (is_playing_sound == 0) {
+ const float time = sound_sync_scene(scene);
if (finite(time)) {
- int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
+ int ncfra = time * (float)FPS + 0.5f;
if (ncfra != scene->r.cfra) {
scene->r.cfra = ncfra;
ED_update_for_newframe(CTX_data_main(C), scene, 1);