diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-05-25 20:51:47 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-05-25 20:51:47 -0400 |
commit | 985bde3fb7a07ca261a913afdf005ff0ceacc736 (patch) | |
tree | 3bf4a6576651ada030de14e58978da99ca766573 | |
parent | c9ef2d37bbd5f44415b7470605e31ba6b28fbdf1 (diff) | |
parent | 53bf17ada858f000c59ffdb53146599f225a7de6 (diff) | |
download | AntennaPod-985bde3fb7a07ca261a913afdf005ff0ceacc736.zip |
Merge pull request #832 from TomHennen/fix_829
reverting to tryLock for getPosition
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java | 4 |
1 files changed, 3 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 243ee78e4..7a8e38c59 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 @@ -534,7 +534,9 @@ public class PlaybackServiceMediaPlayer { * Returns the position of the current media object or INVALID_TIME if the position could not be retrieved. */ public int getPosition() { - playerLock.lock(); + if (!playerLock.tryLock()) { + return INVALID_TIME; + } int retVal = INVALID_TIME; if (playerStatus == PlayerStatus.PLAYING |