mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

The previous code assumed that the `VBRI` Table of Contents (ToC) covers all the MP3 data in the file. In a file with an invalid VBRI ToC where this isn't the case, this results in playback silently stopping mid-playback (and either advancing to the next item, or continuing to count up the playback clock forever). This change considers the `bytes` field to determine the end of the MP3 data, in addition to deriving it from the ToC. If they disagree we log a warning and take the max value. This is because we handle accidentally reading non-MP3 data at the end (or hitting EoF) better than stopping reading valid MP3 data partway through. Issue: androidx/media#1904 #cherrypick PiperOrigin-RevId: 700319250 (cherry picked from commit 46578ee0a6e8adf4c56b7b45b43713b132e35cca)
Test data module
Provides sample data for media unit and instrumentation tests.