Fix hanging after loading an unparsable/colored file
authorRené Stadler <mail@renestadler.de>
Thu, 29 Nov 2007 13:34:35 +0000 (15:34 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Thu, 11 Sep 2014 18:51:41 +0000 (20:51 +0200)
debug-viewer/GstDebugViewer/Plugins/Timeline.py

index 4ea47d1..1b4cec8 100644 (file)
@@ -90,15 +90,20 @@ class LineFrequencySentinel (object):
             return
 
         last_ts = None
+        i = 0
+        UNPARSABLE_LIMIT = 500
         for row in iter_model_reversed (self.model):
             last_ts = row[model.COL_TIME]
             # FIXME: We ignore 0 here (unparsable lines!), this should be
             # handled differently!
+            i += 1
+            if i == UNPARSABLE_LIMIT:
+                break
             if last_ts:
                 last_index = row.path[0]
                 break
 
-        if last_ts is None:
+        if last_ts is None or last_ts < first_ts:
             return
 
         step = int (float (last_ts - first_ts) / float (self.n_partitions))