[longomatch] Handle remuxing errors in windows gracefully
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Handle remuxing errors in windows gracefully
- Date: Sun, 13 Oct 2013 00:28:04 +0000 (UTC)
commit 3312a0009dc383c3559e82c4845ea9e01b8252db
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sat Oct 12 22:09:32 2013 +0200
Handle remuxing errors in windows gracefully
LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
index 498c751..a65f951 100644
--- a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
@@ -282,7 +282,21 @@ namespace LongoMatch.Gui
tmpFile = tmpFile + ".tmp";
}
- System.IO.File.Move (outFile, tmpFile);
+ try {
+ System.IO.File.Move (outFile, tmpFile);
+ } catch (Exception ex) {
+ /* Try to fix "Sharing violation on path" in windows
+ * wait a bit more until the file lock is released */
+ Log.Exception (ex);
+ System.Threading.Thread.Sleep (5 * 1000);
+ try {
+ System.IO.File.Move (outFile, tmpFile);
+ } catch (Exception ex2) {
+ Log.Exception (ex2);
+ /* It failed again, just skip remuxing */
+ return;
+ }
+ }
Remuxer remuxer = new Remuxer(PreviewMediaFile.DiscoverFile(tmpFile),
outFile, muxer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]