summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-08-18 14:02:31 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-08-18 14:02:31 +0200
commit6336db46edafc45821c6c046faee5d1b90d36169 (patch)
treeb8c06c6b2ac814e26f4476a4e8857e2c85a718e0
parentbd2d65f6f902cc9735d667989071d42e8b2f9efe (diff)
downloadAntennaPod-6336db46edafc45821c6c046faee5d1b90d36169.zip
Made sure that mediaplayeractivity loads progress information as soon as
possible
-rw-r--r--src/de/danoeh/antennapod/activity/MediaplayerActivity.java8
-rw-r--r--src/de/danoeh/antennapod/service/PlaybackService.java6
2 files changed, 12 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java
index d8c9c02b9..c55b06855 100644
--- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -81,6 +81,12 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity
bindToService();
}
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mediaInfoLoaded = false;
+ }
+
protected OnClickListener playbuttonListener = new OnClickListener() {
@Override
public void onClick(View v) {
@@ -492,7 +498,7 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity
txtvPosition.setText(Converter.getDurationStringLong((media
.getPosition())));
- if (!playbackService.isShouldStream()) {
+ if (media.getDuration() != 0) {
txtvLength.setText(Converter.getDurationStringLong(media
.getDuration()));
float progress = ((float) media.getPosition())
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java
index d65b0257a..a2c062a64 100644
--- a/src/de/danoeh/antennapod/service/PlaybackService.java
+++ b/src/de/danoeh/antennapod/service/PlaybackService.java
@@ -432,6 +432,10 @@ public class PlaybackService extends Service {
if (AppConfig.DEBUG)
Log.d(TAG, "Resource prepared");
mp.seekTo(media.getPosition());
+ if (media.getDuration() == 0) {
+ if (AppConfig.DEBUG) Log.d(TAG, "Setting duration of media");
+ media.setDuration(mp.getDuration());
+ }
setStatus(PlayerStatus.PREPARED);
if (startWhenPrepared) {
play();
@@ -782,7 +786,7 @@ public class PlaybackService extends Service {
} catch (InterruptedException e) {
if (AppConfig.DEBUG)
Log.d(TAG,
- "Threżad was interrupted while waiting. Finishing now...");
+ "Thread was interrupted while waiting. Finishing now...");
return null;
} catch (IllegalStateException e) {
if (AppConfig.DEBUG)