exit on error
This commit is contained in:
parent
44e9b8fe31
commit
7d1313a3e9
@ -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:
|
# send error messages to email address, like:
|
||||||
# missing playlist
|
# missing playlist
|
||||||
|
@ -49,6 +49,11 @@ if os.path.exists("/etc/ffplayout/ffplayout.conf"):
|
|||||||
else:
|
else:
|
||||||
cfg.read("ffplayout.conf")
|
cfg.read("ffplayout.conf")
|
||||||
|
|
||||||
|
_general = SimpleNamespace(
|
||||||
|
stop=cfg.get('GENERAL', 'stop_on_error'),
|
||||||
|
threshold=cfg.get('GENERAL', 'stop_threshold')
|
||||||
|
)
|
||||||
|
|
||||||
_mail = SimpleNamespace(
|
_mail = SimpleNamespace(
|
||||||
subject=cfg.get('MAIL', 'subject'),
|
subject=cfg.get('MAIL', 'subject'),
|
||||||
server=cfg.get('MAIL', 'smpt_server'),
|
server=cfg.get('MAIL', 'smpt_server'),
|
||||||
@ -395,6 +400,10 @@ def check_sync(begin):
|
|||||||
)
|
)
|
||||||
logger.error('Playlist is {} seconds async!'.format(t_dist))
|
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
|
# prepare input clip
|
||||||
# check begin and length from clip
|
# check begin and length from clip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user