summaryrefslogtreecommitdiff
path: root/src/lib/video_content.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/video_content.cc')
-rw-r--r--src/lib/video_content.cc4
1 files changed, 3 insertions, 1 deletions
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<const Film> 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<double>(time_after_end_fade_start.get()) / fade_out_time.get());
+ return std::max(0.0, 1 - static_cast<double>(fade_amount.get()) / fade_out_time.get());
}
return {};