Apparently the sequencer has its own audiosystem, so the change I did
authorTon Roosendaal <ton@blender.org>
Mon, 3 May 2004 21:21:29 +0000 (21:21 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 3 May 2004 21:21:29 +0000 (21:21 +0000)
for init sound only when needed, was not catched by sequencer.

Somehow, however, the SND_xxx library needs to be set when using the
sequencer... so, here a patch!

source/blender/src/drawseq.c
source/blender/src/editsound.c
source/blender/src/seqaudio.c

index 28b3d4126db42e446f6eb5265aa6df5014532228..cbaeea9cbe055207ebf510d9139a67d883d87015 100644 (file)
@@ -194,6 +194,8 @@ void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2)
        bSound *sound;
 
        audio_makestream(seq->sound);
+       if(seq->sound->stream==NULL) return;
+       
        if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0);
        sound = seq->sound;
        sofs = ((int)( (((float)(seq->startdisp-seq->start))/(float)G.scene->r.frs_sec)*(float)G.scene->audio.mixrate*4.0 )) & (~3);
index 95699032e867f2294975a284bc4c2fb48a31e7f4..9d22b42e4d919965c11d3bf9df1e982467ab6ed6 100644 (file)
@@ -1009,6 +1009,8 @@ void sound_init_audio(void)
        
                ghAudioDeviceInterface = SND_GetAudioDevice();
                ghSoundScene = SND_CreateScene(ghAudioDeviceInterface);
+               // also called after read new file, but doesnt work when no audio initialized
+               sound_initialize_sounds();
        }
 }
 
index 7a2d916716763c388e2af2e2dd23189c32e1dda3..fe9353ca6d4bef642fcd9e1a01016a57650022d1 100644 (file)
@@ -340,6 +340,9 @@ void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown)
        Sequence *seq;
        bSound *sound;
 
+       /* this call used to be in startup */
+       sound_init_audio();
+
        ed= G.scene->ed;
        if(ed) {
                seq= ed->seqbasep->first;