prevend weird asm.js error by reusing things

This commit is contained in:
Jakob Ketterl 2019-05-10 18:29:54 +02:00
parent 7427fa3608
commit b17364e701

View File

@ -1629,14 +1629,16 @@ function audio_preinit()
else if(audio_context.sampleRate>44100*4) else if(audio_context.sampleRate>44100*4)
audio_buffer_size = 4096 * 4; audio_buffer_size = 4096 * 4;
audio_rebuffer = new sdrjs.Rebuffer(audio_buffer_size,sdrjs.REBUFFER_FIXED); if (!audio_rebuffer) {
audio_last_output_buffer = new Float32Array(audio_buffer_size); audio_rebuffer = new sdrjs.Rebuffer(audio_buffer_size,sdrjs.REBUFFER_FIXED);
audio_last_output_buffer = new Float32Array(audio_buffer_size);
//we send our setup packet //we send our setup packet
parsehash(); parsehash();
audio_calculate_resampling(audio_context.sampleRate); audio_calculate_resampling(audio_context.sampleRate);
audio_resampler = new sdrjs.RationalResamplerFF(audio_client_resampling_factor,1); audio_resampler = new sdrjs.RationalResamplerFF(audio_client_resampling_factor,1);
}
ws.send(JSON.stringify({"type":"dspcontrol","action":"start","params":{"output_rate":audio_server_output_rate}})); ws.send(JSON.stringify({"type":"dspcontrol","action":"start","params":{"output_rate":audio_server_output_rate}}));
} }