From: Urban Wallasch Date: Thu, 13 May 2021 08:55:49 +0000 (+0200) Subject: * Count errors in batch mode. X-Git-Tag: v0.3~73 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=1ea2a8f10496855854487509011b4b8908fc8cbe;p=ffpreview.git * Count errors in batch mode. --- diff --git a/ffpreview.py b/ffpreview.py index e71c411..74de7d5 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -947,12 +947,14 @@ def main(): signal.signal(signal.SIGPIPE, signal.SIG_IGN) if cfg['batch']: + errcnt = 0 if isinstance(cfg['vid'], list): for fn in cfg['vid']: - ok = batch_process(fn) - else: - ok = batch_process(cfg['vid']) - exit(0 if ok else 3) + if not batch_process(fn): + errcnt += 1 + elif not batch_process(cfg['vid']): + errcnt += 1 + exit(errcnt) if isinstance(cfg['vid'], list): eprint(0, 'Only using first file in interactive mode.')