revert 27010, sorry but this makes playback of animation unusable & jerky, we can provide some sample files for testing.

This commit is contained in:
2010-02-18 17:00:24 +00:00
parent 3142c4367c
commit b5adeb922f
3 changed files with 4 additions and 15 deletions

View File

@@ -86,8 +86,6 @@ void sound_stop_scene(struct Scene *scene);
void sound_seek_scene(struct bContext *C);
float sound_sync_scene(struct Scene *scene);
int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length);
#endif

View File

@@ -394,11 +394,6 @@ void sound_seek_scene(struct bContext *C)
AUD_unlock();
}
float sound_sync_scene(struct Scene *scene)
{
return AUD_getPosition(scene->sound_scene_handle);
}
int sound_read_sound_buffer(bSound* sound, float* buffer, int length)
{
return AUD_readSound(sound->cache, buffer, length);

View File

@@ -2429,17 +2429,13 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
else sync= (scene->audio.flag & AUDIO_SYNC);
if(sync) {
/* skip frames */
int step = floor(wt->duration * FPS);
if(sad->flag & ANIMPLAY_FLAG_REVERSE) // XXX does this option work with audio?
{ // XXX - no
/* skip frames */
int step = floor(wt->duration * FPS);
scene->r.cfra -= step;
wt->duration -= ((float)step)/FPS;
}
else
{
scene->r.cfra = floor(sound_sync_scene(scene) * FPS);
}
scene->r.cfra += step;
wt->duration -= ((float)step)/FPS;
}
else {
/* one frame +/- */