commit | 130bbc4587e7bab3a12470c0d8080ac30152d136 | [log] [tgz] |
---|---|---|
author | Ian Baker <ibaker@google.com> | Wed Aug 09 18:19:50 2023 +0100 |
committer | Ian Baker <ibaker@google.com> | Thu Aug 10 16:59:50 2023 +0100 |
tree | 886d118384290d28eb1eb5da32f0fb211b1bf42a | |
parent | de76fc180ab7492192c646cb39fb9ee131d583bf [diff] |
Fix vorbis-specific workaround to only compare audio timestamps This workaround was introduced in 2014 [1]. At the time it was correctly only comparing audio timestamps because mAnchorTimeMediaUs only held audio timestamps then. In 2017 [2], mAnchorTimeMediaUs started to hold video timestamps too - at which point this comparison became invalid and a bug was introduced that can lead to control-flow exiting too early when handling an audio buffer with the same timestamp as the preceding video buffer. If this happens at the start of playback, then the **second** audio buffer timestamp is passed to MediaClock::setStartingMediaTime, which can lead to incorrect values being returned from NuPlayerRenderer::getCurrentPosition (when paused at the start of playback). [1] https://cs.android.com/android/_/android/platform/frameworks/av/+/eecb7805bbbb712925d4372c505f8c7f5c4fb5ed [2] https://cs.android.com/android/_/android/platform/frameworks/av/+/17648f365e5914fa772bbfebaf9f5c6a37ddfb99 Test: atest MediaPlayerTest Bug: 283882552 Bug: 282472894 Bug: 263063118 Change-Id: I7fbe6bdaff27c93f15d9d85902306a3f6e00b978