[longomatch] Fix exception when the capturer can't get a frame
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix exception when the capturer can't get a frame
- Date: Wed, 11 Feb 2015 16:36:39 +0000 (UTC)
commit 7e11fe6693aa982c99fd9de28e08eec45016b6d7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Feb 11 17:36:10 2015 +0100
Fix exception when the capturer can't get a frame
.../Services/RenderingJobsManager.cs | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Services/Services/RenderingJobsManager.cs
b/LongoMatch.Services/Services/RenderingJobsManager.cs
index a22e003..b1ca4ff 100644
--- a/LongoMatch.Services/Services/RenderingJobsManager.cs
+++ b/LongoMatch.Services/Services/RenderingJobsManager.cs
@@ -264,6 +264,9 @@ namespace LongoMatch.Services
continue;
}
string image_path = CreateStillImage (file.FilePath, fd);
+ if (image_path == null) {
+ continue;
+ }
videoEditor.AddSegment (file.FilePath, lastTS.MSeconds,
fd.Render.MSeconds - lastTS.MSeconds,
element.Rate, play.Name, file.HasAudio);
@@ -285,6 +288,11 @@ namespace LongoMatch.Services
capturer.Open (filename);
frame = capturer.GetFrame (drawing.Render, true);
capturer.Dispose ();
+ if (frame == null) {
+ Log.Error (String.Format ("Could not get frame for file {0} at pos {1}",
+ filename, drawing.Render.ToMSecondsString ()));
+ return null;
+ }
final_image = Drawing.Utils.RenderFrameDrawingToImage (Config.DrawingToolkit, frame,
drawing);
final_image.Save (path);
return path;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]