[longomatch] Fix seeking when we click directly the timescale



commit cc9ddb50b37b8173801c207f7a7a2720db08e439
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Sep 21 15:11:07 2010 +0200

    Fix seeking when we click directly the timescale
    
    When we click the timescale, the first seek point is always 0 because we
    don't do any other seek. This is different from a normal seek, when the
    timescale emit a last seek point which is different from the real one.

 CesarPlayer/Gui/PlayerBin.cs |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/CesarPlayer/Gui/PlayerBin.cs b/CesarPlayer/Gui/PlayerBin.cs
index d62018e..60f2425 100644
--- a/CesarPlayer/Gui/PlayerBin.cs
+++ b/CesarPlayer/Gui/PlayerBin.cs
@@ -82,8 +82,8 @@ namespace LongoMatch.Gui
 			vscale1.CanFocus = false;	
 			drawbutton.CanFocus = false;
 			seeksQueue = new double[2];
-			seeksQueue [0] = 0;
-			seeksQueue [1] = 0;
+			seeksQueue [0] = -1;
+			seeksQueue [1] = -1;
 		}
 		
 #endregion
@@ -441,8 +441,8 @@ namespace LongoMatch.Gui
 				IsPlayingPrevState = player.Playing;
 				player.Tick -= tickHandler;
 				player.Pause();
-				seeksQueue [0] = 0;
-				seeksQueue [1] = 0;
+				seeksQueue [0] = -1;
+				seeksQueue [1] = -1;
 			}
 			
 			pos = timescale.Value;	
@@ -457,7 +457,7 @@ namespace LongoMatch.Gui
 			if (seeking){
 				/* Releasing the timescale always report value different from the real one. 
 				 * We need to cache previous position and seek again to the this position */				
-				SeekFromTimescale(seeksQueue[0]);
+				SeekFromTimescale(seeksQueue[0] != -1 ? seeksQueue[0] : seeksQueue[1]);
 				seeking=false;				
 				player.Tick += tickHandler;
 				if (IsPlayingPrevState)



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