From f06ad30918394cf1fdd614b2c8403752841adc51 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 Apr 2026 23:41:34 +0200 Subject: Fix incorrect fade outs (#3145). --- src/lib/video_content.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index b6e350d34..25c0fac62 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -435,8 +435,10 @@ VideoContent::fade(shared_ptr film, ContentTime time) const auto const fade_out_time = ContentTime::from_frames(fade_out(), vfr); auto const end = ContentTime::from_frames(length(), vfr) - _parent->trim_end(); auto const time_after_end_fade_start = time - (end - fade_out_time); + /* The first frame of the fade (at time 0) must have some fade */ + auto const fade_amount = time_after_end_fade_start + ContentTime::from_frames(1, vfr); if (time_after_end_fade_start > ContentTime()) { - return std::max(0.0, 1 - static_cast(time_after_end_fade_start.get()) / fade_out_time.get()); + return std::max(0.0, 1 - static_cast(fade_amount.get()) / fade_out_time.get()); } return {}; -- cgit v1.2.3