Commit 06641a2e authored by fred's avatar fred

add subsecond support to soxi fallback

parent 13ac90a4
...@@ -30,10 +30,10 @@ def get_duration(filename): ...@@ -30,10 +30,10 @@ def get_duration(filename):
if not line.startswith('Duration'): if not line.startswith('Duration'):
continue continue
try: try:
hours, minutes, seconds = re.findall(r'(\d\d):(\d\d):(\d\d)', line)[0] hours, minutes, seconds, cs = re.findall(r'(\d\d):(\d\d):(\d\d)\.(\d\d)', line)[0]
except IndexError: except IndexError:
continue continue
return int(hours) * 3600 + int(minutes) * 60 + int(seconds) return int(hours) * 3600 + int(minutes) * 60 + int(seconds) + (int(cs) / 100)
return None return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment