summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzdi <zdi@codeaurora.org>2016-01-20 17:25:24 +0800
committerzdi <zdi@codeaurora.org>2016-01-20 17:27:19 +0800
commitdff8029a9bc8cf7f4e3cc8b0263c1afacb5d2ef4 (patch)
tree7d0530ff7fba9fc3a63c0743b81d0e1550a72f4a
parent56592dc0c89dc6f4c1bbf48b213d9dda136c306b (diff)
downloadandroid_packages_apps_Gallery2-dff8029a9bc8cf7f4e3cc8b0263c1afacb5d2ef4.tar.gz
android_packages_apps_Gallery2-dff8029a9bc8cf7f4e3cc8b0263c1afacb5d2ef4.tar.bz2
android_packages_apps_Gallery2-dff8029a9bc8cf7f4e3cc8b0263c1afacb5d2ef4.zip
Gallery2: Release MediaPlayer when the error occurred.
Release MediaPlayer when the error occurred, avoid exception occurred. Change-Id: Iaa250e9e783f7d8ec06ff8c3603b8e5868c0dc4e CRs-Fixed: 963171
-rw-r--r--src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index f8c70505f..0cb26d2d3 100644
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -273,6 +273,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
}
}
+ mMediaPlayer.reset();
/* Otherwise, pop up an error dialog so the user knows that
* something bad has happened. Only try and pop up the dialog
* if we're attached to a window. When we're going away and no
@@ -299,6 +300,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
if (mOnCompletionListener != null) {
mOnCompletionListener.onCompletion(mMediaPlayer);
}
+ release(true);
}
})
.setCancelable(false)