Only set target gain when enhancer was enabled (#6751)

This commit is contained in:
Matej Drobnič 2023-11-09 20:26:43 +01:00 committed by GitHub
parent 47761bf98f
commit 4d627cc3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -358,7 +358,9 @@ public class ExoPlayerWrapper {
LoudnessEnhancer oldEnhancer = this.loudnessEnhancer; LoudnessEnhancer oldEnhancer = this.loudnessEnhancer;
if (oldEnhancer != null) { if (oldEnhancer != null) {
newEnhancer.setEnabled(oldEnhancer.getEnabled()); newEnhancer.setEnabled(oldEnhancer.getEnabled());
if (oldEnhancer.getEnabled()) {
newEnhancer.setTargetGain((int) oldEnhancer.getTargetGain()); newEnhancer.setTargetGain((int) oldEnhancer.getTargetGain());
}
oldEnhancer.release(); oldEnhancer.release();
} }