mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00

- Make extractor output samples that are uniformly distributed with respect to time, with a target of ~10 samples per second. The old approach could in theory put every frame into its own sample, which would be very inefficient downstream because we'd need to pass them individually to MediaCodec. It could also put data corresponding to a long duration of time into a single sample (e.g. if the sample rate of the content is low), which is bad downstream because we decide whether to set the decodeOnly flag on a per sample basis. More generally, the new approach is more predictable :). - Stop using the WavSeekMap to get sample timestamps, and instead calculate them directly from the number of frames output. It's more obviously correct, particularly for data formats like IMA ADPCM where we'll need to adjust the data prior to output. PiperOrigin-RevId: 285750010