Consider not calling doSomework every second when paused and fully buffered
@tonihei is already working on this.
Since Apr 17, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.6.0
More version details
No response
Devices that reproduce the issue
All
Devices that do not reproduce the issue
N/A
Reproducible in the demo app?
Yes
Reproduction steps
Play something then pause, doSomeWork keeps being called even if there's no reasons, as unpausing will restart it anyway.
Expected result
Optimize CPU usage and keep doing nothing when there's for sure nothing to do.
I report this as bug report, because IMO it is, but it's probably a feature request to optimize this part.
The main reason is because of Samsung devices that will keep restarting apps that support media resumption.
In my case my app on restart will restore the queue and already preload the media in paused status for faster restart from media session. In some cases I even have 2 players in that state.
I expect those players to no consume any CPU, but they do even if not much it's nearly all day long due to the app being restarted by the OS.
Actual result
doSomeWork is still called regularly.
Media
N/A
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.