[longomatch] Fix setting Ratio when the video info is missing



commit 64bd3b20acf616a0bc40cb65e51ca29f1a79c3e0
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Dec 22 20:41:54 2014 +0100

    Fix setting Ratio when the video info is missing

 LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index 7b685ae..615516c 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -427,7 +427,11 @@ namespace LongoMatch.Gui
                                this.fileSet = fileSet;
                                angle = MediaFileAngle.Angle1;
                                activeFile = fileSet.GetAngle (angle);
-                               videowindow.Ratio = (float)(activeFile.VideoWidth * activeFile.Par / 
activeFile.VideoHeight);
+                               if (activeFile.VideoHeight != 0) {
+                                       videowindow.Ratio = (float)(activeFile.VideoWidth * activeFile.Par / 
activeFile.VideoHeight);
+                               } else {
+                                       videowindow.Ratio = 1;
+                               }
                                try {
                                        Log.Debug ("Opening new file " + activeFile.FilePath);
                                        player.Open (activeFile.FilePath);


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