[longomatch] Fix rendering when drawings are out of the segments



commit 48e308845897c2c4a37b12d7412b9bac565fa32d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Sep 22 17:25:20 2014 +0200

    Fix rendering when drawings are out of the segments

 .../Services/RenderingJobsManager.cs               |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Services/Services/RenderingJobsManager.cs 
b/LongoMatch.Services/Services/RenderingJobsManager.cs
index 24a139d..e9c1e01 100644
--- a/LongoMatch.Services/Services/RenderingJobsManager.cs
+++ b/LongoMatch.Services/Services/RenderingJobsManager.cs
@@ -231,17 +231,21 @@ namespace LongoMatch.Services
                        
                        lastTS = play.Start;
                        foreach (FrameDrawing fd in play.Drawings) {
+                               if (fd.Render < play.Start || fd.Render > play.Stop) {
+                                       Log.Warning ("Drawing is not in the segments boundaries " +
+                                                    fd.Render.ToMSecondsString ());
+                                       continue;
+                               }
                                string image_path = CreateStillImage (element.File.FilePath, fd);
                                videoEditor.AddSegment (element.File.FilePath, lastTS.MSeconds,
                                                       fd.Render.MSeconds - lastTS.MSeconds,
                                                       element.Rate, play.Name, element.File.HasAudio);
-                               videoEditor.AddImageSegment (image_path, fd.Render.MSeconds,
-                                                           fd.Pause.MSeconds, play.Name);
+                               videoEditor.AddImageSegment (image_path, 0, fd.Pause.MSeconds, play.Name);
                                lastTS = fd.Render;
                        }
                        videoEditor.AddSegment (element.File.FilePath, lastTS.MSeconds,
-                                              play.Stop.MSeconds - lastTS.MSeconds,
-                                              element.Rate, play.Name, element.File.HasAudio);
+                                               play.Stop.MSeconds - lastTS.MSeconds,
+                                               element.Rate, play.Name, element.File.HasAudio);
                        return true;
                }
 


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