mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-23 07:25:25 +01:00
Catch crash when device does not support LoudnessEnhancer properly (#7390)
This commit is contained in:
parent
f32d5ccb30
commit
5ea92f68b1
@ -399,11 +399,15 @@ public class ExoPlayerWrapper {
|
||||
LoudnessEnhancer newEnhancer = new LoudnessEnhancer(audioStreamId);
|
||||
LoudnessEnhancer oldEnhancer = this.loudnessEnhancer;
|
||||
if (oldEnhancer != null) {
|
||||
newEnhancer.setEnabled(oldEnhancer.getEnabled());
|
||||
if (oldEnhancer.getEnabled()) {
|
||||
newEnhancer.setTargetGain((int) oldEnhancer.getTargetGain());
|
||||
try {
|
||||
newEnhancer.setEnabled(oldEnhancer.getEnabled());
|
||||
if (oldEnhancer.getEnabled()) {
|
||||
newEnhancer.setTargetGain((int) oldEnhancer.getTargetGain());
|
||||
}
|
||||
oldEnhancer.release();
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, e.toString());
|
||||
}
|
||||
oldEnhancer.release();
|
||||
}
|
||||
|
||||
this.loudnessEnhancer = newEnhancer;
|
||||
|
Loading…
Reference in New Issue
Block a user