Fix NPE in applyReplayGain
refreshReplayGainValues may get called from onSharedPreferenceChanged where we didn't yet prepare a media player. Ensure that refreshReplayGainValues() does not trigger an update in such situations, as there is nothing to refresh.
This commit is contained in:
parent
f631fb873d
commit
cc9b738cc4
@ -684,8 +684,12 @@ public final class PlaybackService extends Service
|
||||
* the (maybe just changed) user settings
|
||||
*/
|
||||
private void refreshReplayGainValues() {
|
||||
applyReplayGain(mMediaPlayer);
|
||||
applyReplayGain(mPreparedMediaPlayer);
|
||||
if (mMediaPlayer != null) {
|
||||
applyReplayGain(mMediaPlayer);
|
||||
}
|
||||
if (mPreparedMediaPlayer != null) {
|
||||
applyReplayGain(mPreparedMediaPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshDuckingValues() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user