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

Before this change, the value of the `dwLength` in the stream header was interpreted as the number of chunks in the file. Seeking and timestamp calculation use the media duration and total chunk count. However, in some files the `dwLength` field appears not to store the number of chunks. For example, there are CBR MP3 and AC3 files where this field seems to store the total number of bytes of compressed media instead. That caused seeking and timestamp calculation to give much smaller values than expected (because the `dwLength` is very large), which broke seeking. Work around this using the `idx1` index header if present. We only support audio formats where every audio sample is a sync sample in AVI, and all chunks should therefore be listed in this index. Based on testing on many sample AVI files this gives a reliable total chunk count and fixes seeking. The test media file is a transcoded version of Big Buck Bunny but manually edited to overwrite the length, rate and sample size header files to simulate the error case. PiperOrigin-RevId: 705103651
Test data module
Provides sample data for media unit and instrumentation tests.