From 3fa210c41408180b19064c7d98928cb457fb21ef Mon Sep 17 00:00:00 2001 From: Max Bechtold Date: Mon, 30 Dec 2019 12:39:59 +0100 Subject: [PATCH] remove check of media type --- .../core/service/playback/LocalPSMP.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 8965f5fbf..9c32e42e0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -668,19 +668,17 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { */ private void setVolumeSync(float volumeLeft, float volumeRight) { playerLock.lock(); - if (media != null && EnumSet.of(MediaType.AUDIO, MediaType.VIDEO).contains(media.getMediaType())) { - Playable playable = getPlayable(); - if (playable instanceof FeedMedia) { - FeedMedia feedMedia = (FeedMedia) playable; - FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences(); - VolumeAdaptionSetting volumeAdaptionSetting = preferences.getVolumeAdaptionSetting(); - float adaptionFactor = volumeAdaptionSetting.getAdaptionFactor(); - volumeLeft *= adaptionFactor; - volumeRight *= adaptionFactor; - } - mediaPlayer.setVolume(volumeLeft, volumeRight); - Log.d(TAG, "Media player volume was set to " + volumeLeft + " " + volumeRight); + Playable playable = getPlayable(); + if (playable instanceof FeedMedia) { + FeedMedia feedMedia = (FeedMedia) playable; + FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences(); + VolumeAdaptionSetting volumeAdaptionSetting = preferences.getVolumeAdaptionSetting(); + float adaptionFactor = volumeAdaptionSetting.getAdaptionFactor(); + volumeLeft *= adaptionFactor; + volumeRight *= adaptionFactor; } + mediaPlayer.setVolume(volumeLeft, volumeRight); + Log.d(TAG, "Media player volume was set to " + volumeLeft + " " + volumeRight); playerLock.unlock(); }