androidx / androidx/media

Why is Download.contentLength significantly larger than the storage consumed?

Open
#532 5 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

I've implemented the DownloadService to allow our Widevine protected DASH content to be watched offline.

To give the user an indication of how much storage space the download is taking, we use the contentLength taken from the Download (which is provided by the DownloadManager).

What we've noticed is that the value returned via the API is significantly (> 10%) larger than the actual storage space consumed.

As an example, I've downloaded a box set containing 23 episodes. Media3 reported the sum total of these assets as 4282024986 bytes (4.28GB). When querying the filesystem, it reports only 3710903506 bytes used (3.71GB).

If anything, I would have expected the filesystem to report higher, due to incomplete storage blocks.

So what is contentLength, if not the size of the storage consumed? Is there a more accurate way to get the download size?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.