exit on error

This commit is contained in:
jb-alvarado 2019-03-11 12:29:47 +01:00
parent 44e9b8fe31
commit 7d1313a3e9
2 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,17 @@
# ------------------------------------------------------------------------------
# sometimes it can happen, that a file is corrupt but still playable,
# this can produce an streaming error over all following files
# the only way in this case is, to stop ffplayout and start it again
# here we only say it can stop, the starting process is in your hand
# best way is a systemd serivce on linux
# stop_threshold: stop ffplayout, if it is async in time above this value
# in copy mode this is tricky
[GENERAL]
stop_on_error = True
stop_threshold = 12
# send error messages to email address, like:
# missing playlist

View File

@ -49,6 +49,11 @@ if os.path.exists("/etc/ffplayout/ffplayout.conf"):
else:
cfg.read("ffplayout.conf")
_general = SimpleNamespace(
stop=cfg.get('GENERAL', 'stop_on_error'),
threshold=cfg.get('GENERAL', 'stop_threshold')
)
_mail = SimpleNamespace(
subject=cfg.get('MAIL', 'subject'),
server=cfg.get('MAIL', 'smpt_server'),
@ -395,6 +400,10 @@ def check_sync(begin):
)
logger.error('Playlist is {} seconds async!'.format(t_dist))
if _general.stop and t_dist > _general.threshold:
logger.error('Sync tolerance value exceeded, program is terminated')
exit()
# prepare input clip
# check begin and length from clip