diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-09-08 12:06:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-08 12:06:20 +0200 |
commit | 5ea92f68b1cd964f42a0c621d81ea873ca73e75d (patch) | |
tree | 1ef094c884ab18bbf323b12db2371bbf82f9187c | |
parent | f32d5ccb30f5e346cdf2c6c4a674f8e600a42a92 (diff) | |
download | AntennaPod-5ea92f68b1cd964f42a0c621d81ea873ca73e75d.zip |
Catch crash when device does not support LoudnessEnhancer properly (#7390)
-rw-r--r-- | playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/ExoPlayerWrapper.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/ExoPlayerWrapper.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/ExoPlayerWrapper.java index 9816c2231..bdeca417a 100644 --- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/ExoPlayerWrapper.java +++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/ExoPlayerWrapper.java @@ -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; |