From 6877d46979adde9db1ba84a934c4628714ce18d3 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 15 Dec 2019 12:27:52 +0100 Subject: [PATCH] fix case when playlist is to short and last clip has seek in value --- ffplayout.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ffplayout.py b/ffplayout.py index 7bb8ce4b..f96e2041 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -902,14 +902,21 @@ def handle_list_end(probe, new_length, src, begin, dur, seek, out): messenger.info( 'We are over time, new length is: {0:.2f}'.format(new_length)) - if dur > new_length > 1.5: + missing_secs = abs(new_length - (dur - seek)) + + if dur > new_length > 1.5 and dur - seek >= new_length: src_cmd = src_or_dummy(probe, src, dur, seek, new_out) elif dur > new_length > 0.0: messenger.info( 'Last clip less then 1.5 second long, skip:\n{}'.format(src)) src_cmd = None + + if new_length > dur - seek: + new_playlist = False + messenger.error( + 'Reach playlist end,\n{0:.2f} seconds needed.'.format( + missing_secs)) else: - missing_secs = abs(new_length - dur) new_out = out new_playlist = False src_cmd = src_or_dummy(probe, src, dur, seek, out)