Reset thread when audioWorklet.addModule called after context starts
Before audioWorklet.addModule() gets called, BaseAudioContext does not have a valid AudioWorkletThread so it cannot access to the worklet functionality, eventually causing the page to crash. This CL introduces the dynamic thread switching: if the context already started with the regular thread, then switch it with the worklet thread when audioWorklet.addModule() call is resolved. The dynamic thread switching on the real-time audio context makes the context rendering to stop and restart. This might cause audio glitches in the audio stream. With this fix, the attached layout test does not crash anymore. Bug: 774566 Test: worklet-context-interaction.html Change-Id: I2dc8e723a1b88d3a56fbd49aeb4e64c304d48dad Reviewed-on: https://chromium-review.googlesource.com/722126Reviewed-by:Raymond Toy <rtoy@chromium.org> Commit-Queue: Hongchan Choi <hongchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#509580}
Showing
Please register or sign in to comment