这是indexloc提供的服务,不要输入任何密码
Skip to content

Consider not calling doSomework every second when paused and fully buffered #2336

@Tolriq

Description

@Tolriq

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions