summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2007-11-22 11:03:09 +0200
committerRené Stadler <mail@renestadler.de>2007-11-22 11:03:09 +0200
commit8305ed8dceefb7df11d0d0b567b222e39ad241a2 (patch)
tree290f1c997ad7971ffc62bb12dac11633d58c9649
parent0e2715c0cf1b204c8ebf31055cf56a10d5af6fcc (diff)
Clamp timeline mouse position to actual range
-rw-r--r--GstDebugViewer/Plugins/Timeline.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/GstDebugViewer/Plugins/Timeline.py b/GstDebugViewer/Plugins/Timeline.py
index 7c1b7c9..195fba6 100644
--- a/GstDebugViewer/Plugins/Timeline.py
+++ b/GstDebugViewer/Plugins/Timeline.py
@@ -551,6 +551,12 @@ class TimelineFeature (FeatureBase):
data = self.timeline.freq_sentinel.data
if not data:
return True
+
+ if pos < 0:
+ pos = 0
+ elif pos >= len (data):
+ pos = len (data) - 1
+
count = sum (data[:pos + 1])
row = self.log_model[count]