fixing the incorrect handling of the last timeline event on video processing