mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-24 16:02:13 +01:00
If already seeking, wait for current seek to complete
This commit is contained in:
parent
860741a7bb
commit
e4bb88f1f2
@ -500,12 +500,19 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre
|
|||||||
statusBeforeSeeking = playerStatus;
|
statusBeforeSeeking = playerStatus;
|
||||||
setPlayerStatus(PlayerStatus.SEEKING, media);
|
setPlayerStatus(PlayerStatus.SEEKING, media);
|
||||||
}
|
}
|
||||||
|
if(seekLatch != null && seekLatch.getCount() > 0) {
|
||||||
|
try {
|
||||||
|
seekLatch.await(3, TimeUnit.SECONDS);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
seekLatch = new CountDownLatch(1);
|
seekLatch = new CountDownLatch(1);
|
||||||
mediaPlayer.seekTo(t);
|
mediaPlayer.seekTo(t);
|
||||||
try {
|
try {
|
||||||
seekLatch.await(10, TimeUnit.SECONDS);
|
seekLatch.await(3, TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
} else if (playerStatus == PlayerStatus.INITIALIZED) {
|
} else if (playerStatus == PlayerStatus.INITIALIZED) {
|
||||||
media.setPosition(t);
|
media.setPosition(t);
|
||||||
|
Loading…
Reference in New Issue
Block a user