Skip to content

Commit bc6174f

Browse files
committed
Ensure SetJson() method recalculates project duration (min/max times)
1 parent 959947a commit bc6174f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Timeline.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ void Timeline::calculate_max_duration() {
812812
// If no clips or effects exist, set min_time to 0
813813
if (clips.empty() && effects.empty()) {
814814
min_time = 0.0;
815+
max_time = 0.0;
815816
}
816817
}
817818

@@ -1302,6 +1303,10 @@ void Timeline::SetJsonValue(const Json::Value root) {
13021303
preview_width = info.width;
13031304
preview_height = info.height;
13041305

1306+
// Resort (and recalculate min/max duration)
1307+
sort_clips();
1308+
sort_effects();
1309+
13051310
// Re-open if needed
13061311
if (was_open)
13071312
Open();

0 commit comments

Comments
 (0)