mirror of
https://github.com/androidx/media.git
synced 2025-05-16 12:09:50 +08:00

Previously, `getTrackFormat()` in `MediaExtractorCompat` returned a `MediaFormat` without setting `MediaFormat.KEY_DURATION`. With this change: - `MediaFormat.KEY_DURATION` is set based on the track's duration, if available. - If the track duration is unset, the duration from the seek map is used as a fallback. - When neither duration is set, `MediaFormat.KEY_DURATION` remains unset. This ensures that `MediaFormat.KEY_DURATION` is populated when possible, enhancing duration information availability. PiperOrigin-RevId: 691395114