mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00

We currently default to not caching data if the content length cannot be resolved once the DataSource has been open. The reason for this is to avoid caching progressive live streams. By doing this we were accidentally not caching in other places where caching is possible, such as DASH/SS/HLS segments during playback if the server doesn't include a Content-Length header. Also HLS encryption key chunks, which were very unlikely to be cached during playback because we explicitly set FLAG_ALLOW_GZIP (which normally stops content length from resolving) without setting FLAG_ALLOW_CACHING_UNKNOWN_LENGTH. It seems like a good idea to flip the default at this point, and explicitly disable caching in the one case where we want that to happen. PiperOrigin-RevId: 223994110