diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index fe9353ca6d4..ce64878cf1e 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -338,17 +338,13 @@ void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown) static SDL_AudioSpec desired; Editing *ed; Sequence *seq; - bSound *sound; - - /* this call used to be in startup */ - sound_init_audio(); + bSound *sound=NULL; ed= G.scene->ed; if(ed) { seq= ed->seqbasep->first; while(seq) { - if ((seq->type == SEQ_SOUND) && (seq->sound)) - { + if ((seq->type == SEQ_SOUND) && (seq->sound)) { sound = ((bSound*)seq->sound); seq->curpos = (int)( (((float)((float)startframe-(float)seq->start)/(float)G.scene->r.frs_sec)*((float)G.scene->audio.mixrate)*4 )); } @@ -356,6 +352,12 @@ void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown) } } + if(sound) { + /* this call used to be in startup */ + sound_init_audio(); + } + else return; + if (!(duration + mixdown)) { desired.freq=G.scene->audio.mixrate; desired.format=AUDIO_S16SYS;