Catch ffprobe empty stdout (#4016)

This commit is contained in:
Nicolas Mowen 2022-10-04 18:56:04 -06:00 committed by GitHub
parent 60ad38261b
commit 65c211bb6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ class RecordingMaintainer(threading.Thread):
f"{cache_path}",
]
p = sp.run(ffprobe_cmd, capture_output=True)
if p.returncode == 0:
if p.returncode == 0 and p.stdout.decode():
duration = float(p.stdout.decode().strip())
end_time = start_time + datetime.timedelta(seconds=duration)
self.end_time_cache[cache_path] = (end_time, duration)