[longomatch] Remove output file when the remux is cancelled



commit 8f229e624cfe0ee558edbb0096ce0c3959aa9526
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Jan 2 16:49:00 2015 +0100

    Remove output file when the remux is cancelled

 LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs b/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
index e033cf7..937d869 100644
--- a/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
@@ -101,7 +101,14 @@ namespace LongoMatch.Video.Utils
                        
                        /* Wait until the thread call Destroy on the dialog */
                        dialog.Run();
-                       return cancelled ? null : outputFilepath;
+                       if (cancelled) {
+                               try {
+                                       File.Delete(outputFilepath);
+                               } catch {
+                               }
+                               outputFilepath = null;
+                       }
+                       return outputFilepath;
                }
                
                void Error (string error) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]