Fix related to audio crash. Made the check for when audio_init runs a

tinsy bit more strict. Now it did it for each ALT+A play anim.

I leave the debug print in still, for testing.
This commit is contained in:
Ton Roosendaal 2004-05-06 19:57:21 +00:00
parent dba290879d
commit ef0adbd15f

@ -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;