Open yschimke opened 2 years ago
Offload integration in ExoPlayer is still an experimental feature and subject to future changes. The final integration likely uses a different way to set the offload preferences other than hardcoding them in the constructor of DefaultAudioSink
. I'll keep this issue open because changing the value is not currently supported.
There are still some edge cases that can cause offload to be disabled until process restart.
If you start playing with a headset that isn't compatible with offload, then even if you change later to a compatible headset, it will keep using non offloaded.
But good to hear about the final integration, sounds good.
Feel free to close if it's no longer planned.
Flagging that for any apps that want mixed formats on Wear, such as Music + Podcasts, may want to enable/disable offload when a new playlist is selected. Tearing down exoplayer seems very disruptive for this.
Are there other options to achieve this? Say a decorating AudioSink?
Use case description
Audio offload may remove features such as volume normalization, gapless playback, playback speed. If offload is provided as a user preference, it should be possible to change the mode in DefaultAudioSink without restarting to destroy the ExoPlayer instance and it's AudioSink.
Proposed solution
Allow changing the offload mode on an existing DefaultAudioSink, potentially only when not actively playing.
Alternatives considered
Some mechanism to tear down an ExoPlayer instance and rebuild it?