From 189d73dd871a7fdf175cb76ab7c473f0d1a4e223 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 15 Dec 2013 21:03:23 -0800 Subject: Render some MIDI samples even when stopped Because stopping MIDI playback puts any playing notes into release phase, they should be rendered. Ideally it could stop rendering once output goes silent. --- OpenAL32/alMidi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenAL32/alMidi.c') diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c index 00068ffc..0f269463 100644 --- a/OpenAL32/alMidi.c +++ b/OpenAL32/alMidi.c @@ -442,11 +442,12 @@ static void FSynth_process(FSynth *self, ALuint SamplesToDo, ALfloat (*restrict ALenum state = synth->State; ALuint total = 0; + if(state == AL_INITIAL) + return; if(state != AL_PLAYING) { - if(state == AL_PAUSED) - fluid_synth_write_float(self->Synth, SamplesToDo, DryBuffer[FrontLeft], 0, 1, - DryBuffer[FrontRight], 0, 1); + fluid_synth_write_float(self->Synth, SamplesToDo, DryBuffer[FrontLeft], 0, 1, + DryBuffer[FrontRight], 0, 1); return; } -- cgit v1.2.3