• Markus Handell's avatar
    WebmMuxer: Do not produce duplicate timestamps. · 4234d1eb
    Markus Handell authored
    This change fixes a problem where the WebmMuxer will
    produce duplicate timestamps leading to audio gaps or
    jerky video in WebM files, provided both audio and
    video is recorded, and timestamps of all incoming
    frames are not monotonically increasing. This
    resulted in the WebmMuxer rewriting apparently older
    frames' timestamps as the newest one encountered.
    
    With this change we now normally don't change the incoming
    timestamps, but always output a sorted sequence of frames
    to the underlying Matroska muxer. Timestamps are
    exceptionally changed when it's found that each stream's
    timestamps aren't monotonically increasing.
    
    Additionally, the webm_muxer got it's unit tests updated.
    
    Bug: 873963
    Change-Id: I6b81ef32f0f7f1034a56da3bca07186221fefaea
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033253
    Commit-Queue: Markus Handell <handellm@google.com>
    Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
    Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#738738}
    4234d1eb
webm_muxer_unittest.cc 17 KB