diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-02-18 08:40:15 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-02-18 08:50:10 +0100 |
commit | d818901b80fb29c6e80d553ef258e431696603c2 (patch) | |
tree | eab81d23820116f5dc370d5037e5bc14edce447d | |
parent | b65efb3cbab304c7926899e8e0f4682185464af0 (diff) | |
download | AntennaPod-d818901b80fb29c6e80d553ef258e431696603c2.zip |
Give it some time to read current position
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java index a82e82506..d3a7fdee4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java @@ -604,7 +604,11 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre * Returns the position of the current media object or INVALID_TIME if the position could not be retrieved. */ public int getPosition() { - if (!playerLock.tryLock()) { + try { + if (!playerLock.tryLock(50, TimeUnit.MILLISECONDS)) { + return INVALID_TIME; + } + } catch (InterruptedException e) { return INVALID_TIME; } |