diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-12-30 02:47:13 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-12-30 02:47:13 +0100 |
commit | aba5568176b2c18d07bab2b60b9c1b4e558278d3 (patch) | |
tree | e85e9ae66186bbdafc470c95bcb45e5cf41d446d /src | |
parent | 162e1d4f9811f64f9f0e952ef850a92aa4614a63 (diff) | |
download | AntennaPod-aba5568176b2c18d07bab2b60b9c1b4e558278d3.zip |
Avoid seeking to position 0 (#208).
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java index 6ab2c758b..f6e749324 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java @@ -211,9 +211,10 @@ public class PlaybackServiceMediaPlayer { setSpeed(Float.parseFloat(UserPreferences.getPlaybackSpeed())); mediaPlayer.start(); - if (playerStatus == PlayerStatus.PREPARED) { + if (playerStatus == PlayerStatus.PREPARED && media.getPosition() > 0) { mediaPlayer.seekTo(media.getPosition()); } + setPlayerStatus(PlayerStatus.PLAYING, media); pausedBecauseOfTransientAudiofocusLoss = false; if (android.os.Build.VERSION.SDK_INT >= 14) { @@ -323,7 +324,10 @@ public class PlaybackServiceMediaPlayer { videoSize = new Pair<Integer, Integer>(vp.getVideoWidth(), vp.getVideoHeight()); } - mediaPlayer.seekTo(media.getPosition()); + if (media.getPosition() > 0) { + mediaPlayer.seekTo(media.getPosition()); + } + if (media.getDuration() == 0) { if (AppConfig.DEBUG) Log.d(TAG, "Setting duration of media"); |