summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-01-31 10:31:18 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-01-31 10:31:18 -0800
commit1c5d28d8cd5a175f04055258d6290b520e246c45 (patch)
treea9051a722acdb0bb74b849fa35361bb52976b20e /src
parente17d7a4d93c2d56ef21b67ae555cd8df3b352bae (diff)
parent49ce6546e4484cbd5e64b8a9f401f62358b01dc7 (diff)
downloadandroid_packages_apps_Gallery2-1c5d28d8cd5a175f04055258d6290b520e246c45.tar.gz
android_packages_apps_Gallery2-1c5d28d8cd5a175f04055258d6290b520e246c45.tar.bz2
android_packages_apps_Gallery2-1c5d28d8cd5a175f04055258d6290b520e246c45.zip
Merge "Gallery2: Fix force close issue when mute some videos"
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/app/MuteVideo.java16
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/app/VideoUtils.java5
2 files changed, 18 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/MuteVideo.java b/src/com/android/gallery3d/app/MuteVideo.java
index a385fbb9f..dd05397d2 100644..100755
--- a/src/com/android/gallery3d/app/MuteVideo.java
+++ b/src/com/android/gallery3d/app/MuteVideo.java
@@ -87,9 +87,19 @@ public class MuteVideo {
VideoUtils.startMute(mFilePath, mDstFileInfo);
SaveVideoFileUtils.insertContent(
mDstFileInfo, mActivity.getContentResolver(), mUri);
- } catch (IOException e) {
- Toast.makeText(mActivity, mActivity.getString(R.string.video_mute_err),
- Toast.LENGTH_SHORT).show();
+ } catch (Exception e) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ Toast.makeText(mActivity, mActivity.getString(R.string.video_mute_err),
+ Toast.LENGTH_SHORT).show();
+ if (mMuteProgress != null) {
+ mMuteProgress.dismiss();
+ mMuteProgress = null;
+ }
+ }
+ });
+ return;
}
// After muting is done, trigger the UI changed.
mHandler.post(new Runnable() {
diff --git a/src/com/android/gallery3d/app/VideoUtils.java b/src/com/android/gallery3d/app/VideoUtils.java
index 76d5d1e02..4f551a67d 100644..100755
--- a/src/com/android/gallery3d/app/VideoUtils.java
+++ b/src/com/android/gallery3d/app/VideoUtils.java
@@ -226,6 +226,11 @@ public class VideoUtils {
} catch (IllegalStateException e) {
// Swallow the exception due to malformed source.
Log.w(LOGTAG, "The source video file is malformed");
+ File f = new File(dstPath);
+ if (f.exists()) {
+ f.delete();
+ }
+ throw e;
} finally {
muxer.release();
}