summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-11 17:20:30 +0200
committerwm4 <wm4@nowhere>2015-05-11 17:20:30 +0200
commita5aa58c63c6f0b1ee43d8ac90e0ae0dd57de194a (patch)
treea3b2d091c1311fa0cd5a67a6a6adeb776d52db88 /TOOLS
parent47ee67b8a24d2acc40b959df7d4ceb98c6e3c1c8 (diff)
downloadmpv-a5aa58c63c6f0b1ee43d8ac90e0ae0dd57de194a.tar.bz2
mpv-a5aa58c63c6f0b1ee43d8ac90e0ae0dd57de194a.tar.xz
TOOLS/stats-conv.py: add another event type
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/stats-conv.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/TOOLS/stats-conv.py b/TOOLS/stats-conv.py
index 0390a52d30..6f8c424fec 100755
--- a/TOOLS/stats-conv.py
+++ b/TOOLS/stats-conv.py
@@ -26,8 +26,8 @@ Currently, the following event types are supported:
'end' <name> end of the named event
'value' <float> <name> a normal value (as opposed to event)
'event-timed' <ts> <name> singular event at the given timestamp
- 'value-timed' <ts> <float> <name>
- a value for an event at the given timestamp
+ 'value-timed' <ts> <float> <name> a value for an event at the given timestamp
+ 'range-timed' <ts1> <ts2> <name> like start/end, but explicit times
<name> singular event (same as 'signal')
"""
@@ -91,6 +91,15 @@ for line in [line.split("#")[0].strip() for line in open(filename, "r")]:
val = int(val) / SCALE - G.start
e = get_event(name, "event-signal")
e.vals.append((val, 1))
+ elif event.startswith("range-timed "):
+ _, ts1, ts2, name = event.split(" ", 3)
+ ts1 = int(ts1) / SCALE - G.start
+ ts2 = int(ts2) / SCALE - G.start
+ e = get_event(name, "event")
+ e.vals.append((ts1, 0))
+ e.vals.append((ts1, 1))
+ e.vals.append((ts2, 1))
+ e.vals.append((ts2, 0))
elif event.startswith("value-timed "):
_, tsval, val, name = event.split(" ", 3)
tsval = int(tsval) / SCALE - G.start