summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-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();
}