Reverting my windows build fix because it breaks the bug fix committed in r40995
authorAndrew Wiggin <ender79bl@gmail.com>
Fri, 14 Oct 2011 07:41:45 +0000 (07:41 +0000)
committerAndrew Wiggin <ender79bl@gmail.com>
Fri, 14 Oct 2011 07:41:45 +0000 (07:41 +0000)
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/sound.c
source/blender/editors/screen/screen_ops.c
source/blender/windowmanager/intern/wm_event_system.c

index 081fb8dc132d7e5aad0a1b9da181b862a01033e8..3728dd41089e805c967b8b5ecb01032255cbc863 100644 (file)
@@ -35,7 +35,6 @@
  *  \author nzc
  */
 
-#define SOUND_ERR_FLT FLT_MIN
 #define SOUND_WAVE_SAMPLES_PER_SECOND 250
 
 struct PackedFile;
index b9a02df423ee8c3d17cda44673b5e40ec5fce0ca..649b4f0b724c04c747a23e732a7130da93aeeea8 100644 (file)
@@ -630,7 +630,7 @@ float sound_sync_scene(struct Scene *scene)
                else
                        return AUD_getPosition(scene->sound_scene_handle);
        }
-       return SOUND_ERR_FLT;
+       return .0f/.0f;
 }
 
 int sound_scene_playing(struct Scene *scene)
@@ -787,7 +787,7 @@ static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
 void sound_play_scene(struct Scene *UNUSED(scene)) {}
 void sound_stop_scene(struct Scene *UNUSED(scene)) {}
 void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
-float sound_sync_scene(struct Scene *UNUSED(scene)) { return SOUND_ERR_FLT; }
+float sound_sync_scene(struct Scene *UNUSED(scene)) { return .0f/.0f; }
 int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
 int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
 void sound_read_waveform(struct bSound* sound) { (void)sound; }
index 8d9190ac80c21ad11acb2383cf3db4456bcd1886..a2be1e8fa6f46479103ec2e5ca40259a43a80083 100644 (file)
@@ -2814,7 +2814,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
                else if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
                else sync= (scene->flag & SCE_FRAME_DROP);
                
-               if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && ((time = sound_sync_scene(scene)) != SOUND_ERR_FLT))
+               if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene)))
                        scene->r.cfra = (double)time * FPS + 0.5;
                else
                {
index 4055b6c7d9edad161978f3ccdb419fea304e5fba..074151c9abe52300716214735a951e6be2738c66 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 
 #include "DNA_listBase.h"
 #include "DNA_screen_types.h"
@@ -46,7 +47,6 @@
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
-#include "BLI_math.h"
 
 #include "BKE_blender.h"
 #include "BKE_context.h"
@@ -1791,7 +1791,7 @@ void wm_event_do_handlers(bContext *C)
                                        
                                        if(playing == 0) {
                                                float time = sound_sync_scene(scene);
-                                               if(time != SOUND_ERR_FLT) {
+                                               if(finite(time)) {
                                                        int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
                                                        if(ncfra != scene->r.cfra)      {
                                                                scene->r.cfra = ncfra;