Check the media's own speed before loading video speed

This commit is contained in:
Jonas Kalderstam 2019-09-13 23:22:13 +02:00
parent e5176c6a19
commit 3bcb368bb3
1 changed files with 9 additions and 7 deletions

View File

@ -307,17 +307,19 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
Log.d(TAG, "Audiofocus successfully requested");
Log.d(TAG, "Resuming/Starting playback");
acquireWifiLockIfNecessary();
float playbackSpeed;
if (media.getMediaType() == MediaType.VIDEO) {
playbackSpeed = UserPreferences.getVideoPlaybackSpeed();
} else if (media instanceof FeedMedia) {
float playbackSpeed = SPEED_USE_GLOBAL;
if (media instanceof FeedMedia) {
playbackSpeed = ((FeedMedia) media).getMediaPlaybackSpeed();
} else {
playbackSpeed = SPEED_USE_GLOBAL;
}
if (playbackSpeed == SPEED_USE_GLOBAL) {
playbackSpeed = UserPreferences.getPlaybackSpeed();
if (media.getMediaType() == MediaType.VIDEO) {
playbackSpeed = UserPreferences.getVideoPlaybackSpeed();
} else {
playbackSpeed = UserPreferences.getPlaybackSpeed();
}
}
setPlaybackParams(playbackSpeed, UserPreferences.isSkipSilence());
setVolume(UserPreferences.getLeftVolume(), UserPreferences.getRightVolume());