• Raymond Toy's avatar
    When suspending context, don't clear handlers · 3626b1f1
    Raymond Toy authored
    AudioContext.suspend() would call StopRendering().  This stops the audio
    thread from pulling the graph (eventually) but it also clears out any
    handlers, including those associated with automatic pull nodes for any
    AnalyserNode that isn't connected to the destination.  When the context
    is resumed, the AnalyserNode isn't pulled anymore, so the output never
    changes.
    
    Add a SuspendRendering() method to handle AudioContext.suspend() which
    doesn't clear the handlers.  Then when the context is resumed,
    AnalyserNodes will get pulled again.  Then StopRendering() is used only
    for AudioContext.close() where it is ok to clear out the handlers since
    we can't resume a closed context.
    
    Bug: 1018499
    Change-Id: I4b4ccf688b37e6b81d310d2596cfff9603048876
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903894Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
    Commit-Queue: Raymond Toy <rtoy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#723609}
    3626b1f1
audio_context.cc 24.8 KB