diff options
author | ByteHamster <info@bytehamster.com> | 2020-05-16 19:01:44 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-05-16 22:30:25 +0200 |
commit | df1c298bf6a9fca18c3afda76293f7fce50bf351 (patch) | |
tree | f7dadab913f5226c9a633d9244651474288cf9b6 /core/src/main/java | |
parent | 05ab7dc3fe1bb0edbcaf4580eb1247e27436a7e0 (diff) | |
download | AntennaPod-df1c298bf6a9fca18c3afda76293f7fce50bf351.zip |
Allow to skip even if duration is unknown
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index a83e50506..2570fb1c5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -523,7 +523,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { Context context = getApplicationContext(); if (skipIntro > 0 && playable.getPosition() < skipIntro * 1000) { int duration = getDuration(); - if (skipIntro * 1000 < duration) { + if (skipIntro * 1000 < duration || duration <= 0) { Log.d(TAG, "skipIntro " + playable.getEpisodeTitle()); mediaPlayer.seekTo(skipIntro * 1000); String skipIntroMesg = context.getString(R.string.pref_feed_skip_intro_toast, @@ -1087,7 +1087,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences(); int skipEnd = preferences.getFeedSkipEnding(); if (skipEnd > 0 - && skipEnd < playable.getDuration() + && skipEnd < getDuration() && (remainingTime - (skipEnd * 1000) > 0) && ((remainingTime - skipEnd * 1000) < (getCurrentPlaybackSpeed() * 1000))) { Log.d(TAG, "skipEndingIfNecessary: Skipping the remaining " + remainingTime + " " + skipEnd * 1000 + " speed " + getCurrentPlaybackSpeed()); |