diff options
author | lubiny <lubiny@codeaurora.org> | 2013-10-17 16:51:52 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-02-01 21:48:58 -0800 |
commit | 938e5ef58ca3c485b01d396caf6284386a81d6d9 (patch) | |
tree | 5bb477db476110e5a6110f60d505dd18f0f78efc /src | |
parent | 1c5d28d8cd5a175f04055258d6290b520e246c45 (diff) | |
download | android_packages_apps_Gallery2-938e5ef58ca3c485b01d396caf6284386a81d6d9.tar.gz android_packages_apps_Gallery2-938e5ef58ca3c485b01d396caf6284386a81d6d9.tar.bz2 android_packages_apps_Gallery2-938e5ef58ca3c485b01d396caf6284386a81d6d9.zip |
Gallery2: Seek to trim start time only once when playing
- When playing video in TrimVideo activity, it may enter an endless
loop: Seek to trim start time (actually sought to previous sync frame)
-> Periodic check, if current position < trim startm, seek again.
- This patch adds a flag to ensure seeking to trim start time only once.
Change-Id: I3cd74fbd85546cc35d5c32797ab7f1775f091586
CRs-Fixed: 694431
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/app/TrimVideo.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java index c5d721274..a52c25606 100644 --- a/src/com/android/gallery3d/app/TrimVideo.java +++ b/src/com/android/gallery3d/app/TrimVideo.java @@ -57,6 +57,7 @@ public class TrimVideo extends Activity implements private int mTrimStartTime = 0; private int mTrimEndTime = 0; + private boolean mCheckTrimStartTime; private int mVideoPosition = 0; public static final String KEY_TRIM_START = "trim_start"; public static final String KEY_TRIM_END = "trim_end"; @@ -177,10 +178,11 @@ public class TrimVideo extends Activity implements mVideoPosition = mVideoView.getCurrentPosition(); // If the video position is smaller than the starting point of trimming, // correct it. - if (mVideoPosition < mTrimStartTime) { + if (mCheckTrimStartTime && (mVideoPosition < mTrimStartTime)) { mVideoView.seekTo(mTrimStartTime); mVideoPosition = mTrimStartTime; } + mCheckTrimStartTime = false; // If the position is bigger than the end point of trimming, show the // replay button and pause. if (mVideoPosition >= mTrimEndTime && mTrimEndTime > 0) { @@ -204,6 +206,7 @@ public class TrimVideo extends Activity implements private void playVideo() { mVideoView.start(); + mCheckTrimStartTime = true; mController.showPlaying(); setProgress(); } |