From dff8029a9bc8cf7f4e3cc8b0263c1afacb5d2ef4 Mon Sep 17 00:00:00 2001 From: zdi Date: Wed, 20 Jan 2016 17:25:24 +0800 Subject: Gallery2: Release MediaPlayer when the error occurred. Release MediaPlayer when the error occurred, avoid exception occurred. Change-Id: Iaa250e9e783f7d8ec06ff8c3603b8e5868c0dc4e CRs-Fixed: 963171 --- src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.3