summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hennen <TomHennen@users.noreply.github.com>2015-05-25 20:51:47 -0400
committerTom Hennen <TomHennen@users.noreply.github.com>2015-05-25 20:51:47 -0400
commit985bde3fb7a07ca261a913afdf005ff0ceacc736 (patch)
tree3bf4a6576651ada030de14e58978da99ca766573
parentc9ef2d37bbd5f44415b7470605e31ba6b28fbdf1 (diff)
parent53bf17ada858f000c59ffdb53146599f225a7de6 (diff)
downloadAntennaPod-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.java4
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