• Sergey Ulanov's avatar
    [Fuchsia] Fix FuchsiaAudioRenderer to handle seek correctly · 725ee310
    Sergey Ulanov authored
    FuchsiaAudioRenderer::FlushInternal() is called when seeking media
    stream. It's supposed to flush all pending buffers, so playback can
    resume from the new position. Problem was that there may be a demuxer
    read that's still pending when the function is called. Results of that
    read were still used after flush, but they may correspond to the
    previous position in the stream (before seek). As result the packet
    returned by the pending seek was sitting in the head of the queue
    blocking playback of all other packets for the new position after seek,
    breaking audio playback. This change updates
    FuchsiaAudioRenderer::OnDemuxerStreamReadDone() to drop results if
    FlushInternal() was called while the demuxer read operation was pending.
    
    Bug: b/167613125
    Change-Id: I134eb54f5729194d419226bc2df53012a32c8d4b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422886
    Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
    Commit-Queue: David Dorwin <ddorwin@chromium.org>
    Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#809686}
    725ee310
fuchsia_audio_renderer.cc 19.2 KB