diff options
Diffstat (limited to 'source/blender/sequencer')
-rw-r--r-- | source/blender/sequencer/SEQ_time.h | 1 | ||||
-rw-r--r-- | source/blender/sequencer/intern/render.c | 7 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_edit.c | 8 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_time.c | 17 |
4 files changed, 19 insertions, 14 deletions
diff --git a/source/blender/sequencer/SEQ_time.h b/source/blender/sequencer/SEQ_time.h index 69dc20d39ca..e6e8d75807e 100644 --- a/source/blender/sequencer/SEQ_time.h +++ b/source/blender/sequencer/SEQ_time.h @@ -74,6 +74,7 @@ void SEQ_time_speed_factor_set(const struct Scene *scene, struct Sequence *seq, const float speed_factor); float SEQ_time_start_frame_get(const struct Sequence *seq); +float SEQ_time_content_end_frame_get(const struct Scene *scene, const struct Sequence *seq); void SEQ_time_start_frame_set(const struct Scene *scene, struct Sequence *seq, int timeline_frame); void SEQ_time_update_meta_strip_range(const struct Scene *scene, struct Sequence *seq_meta); diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index 1b6c4b42730..91ecccbe0f8 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -2103,7 +2103,7 @@ void SEQ_render_thumbnails(const SeqRenderData *context, /* Adding the hold offset value (seq->anim_startofs) to the start frame. Position of image not * affected, but frame loaded affected. */ float upper_thumb_bound = SEQ_time_has_right_still_frames(scene, seq) ? - (seq->start + seq->len) : + SEQ_time_content_end_frame_get(scene, seq) : SEQ_time_right_handle_frame_get(scene, seq); upper_thumb_bound = (upper_thumb_bound > view_area->xmax) ? view_area->xmax + frame_step : upper_thumb_bound; @@ -2137,9 +2137,10 @@ void SEQ_render_thumbnails(const SeqRenderData *context, int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Scene *scene, const Sequence *seq) { - const int content_start = max_ii(SEQ_time_left_handle_frame_get(scene, seq), seq->start); + const int content_start = max_ii(SEQ_time_left_handle_frame_get(scene, seq), + SEQ_time_start_frame_get(seq)); const int content_end = min_ii(SEQ_time_right_handle_frame_get(scene, seq), - seq->start + seq->len); + SEQ_time_content_end_frame_get(scene, seq)); const int content_len = content_end - content_start; /* Arbitrary, but due to performance reasons should be as low as possible. */ diff --git a/source/blender/sequencer/intern/strip_edit.c b/source/blender/sequencer/intern/strip_edit.c index 9751ccf18a6..69e43f3679c 100644 --- a/source/blender/sequencer/intern/strip_edit.c +++ b/source/blender/sequencer/intern/strip_edit.c @@ -260,8 +260,8 @@ bool SEQ_edit_move_strip_to_meta(Scene *scene, static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int timeline_frame) { - const float content_start = seq->start; - const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq); + const float content_start = SEQ_time_start_frame_get(seq); + const float content_end = SEQ_time_content_end_frame_get(scene, seq); /* Adjust within range of extended still-frames before strip. */ if (timeline_frame < content_start) { @@ -283,8 +283,8 @@ static void seq_split_set_right_hold_offset(Scene *scene, Sequence *seq, int tim static void seq_split_set_left_hold_offset(Scene *scene, Sequence *seq, int timeline_frame) { - const float content_start = seq->start; - const float content_end = seq->start + SEQ_time_strip_length_get(scene, seq); + const float content_start = SEQ_time_start_frame_get(seq); + const float content_end = SEQ_time_content_end_frame_get(scene, seq); /* Adjust within range of extended still-frames before strip. */ if (timeline_frame < content_start) { diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c index 6725e0a8394..5d953398732 100644 --- a/source/blender/sequencer/intern/strip_time.c +++ b/source/blender/sequencer/intern/strip_time.c @@ -53,7 +53,7 @@ float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_fra { float frame_index; float sta = SEQ_time_start_frame_get(seq); - float end = SEQ_time_start_frame_get(seq) + SEQ_time_strip_length_get(scene, seq) - 1; + float end = SEQ_time_content_end_frame_get(scene, seq) - 1; if (seq->type & SEQ_TYPE_EFFECT) { end = SEQ_time_right_handle_frame_get(scene, seq); @@ -470,8 +470,7 @@ bool SEQ_time_has_left_still_frames(const Scene *scene, const Sequence *seq) bool SEQ_time_has_right_still_frames(const Scene *scene, const Sequence *seq) { - return SEQ_time_right_handle_frame_get(scene, seq) > - SEQ_time_start_frame_get(seq) + SEQ_time_strip_length_get(scene, seq); + return SEQ_time_right_handle_frame_get(scene, seq) > SEQ_time_content_end_frame_get(scene, seq); } bool SEQ_time_has_still_frames(const Scene *scene, const Sequence *seq) @@ -503,6 +502,11 @@ void SEQ_time_start_frame_set(const Scene *scene, Sequence *seq, int timeline_fr seq_time_update_effects_strip_range(scene, seq_sequence_lookup_effects_by_seq(scene, seq)); } +float SEQ_time_content_end_frame_get(const Scene *scene, const Sequence *seq) +{ + return SEQ_time_start_frame_get(seq) + SEQ_time_strip_length_get(scene, seq); +} + int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq) { if (seq->seq1 || seq->seq2) { @@ -518,7 +522,7 @@ int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq) return seq->enddisp; } - return seq->start + SEQ_time_strip_length_get(scene, seq) - seq->endofs; + return SEQ_time_content_end_frame_get(scene, seq) - seq->endofs; } void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int val) @@ -529,7 +533,7 @@ void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int val) val = right_handle_orig_frame - 1; } - seq->startofs = val - seq->start; + seq->startofs = val - SEQ_time_start_frame_get(seq); seq->startdisp = val; /* Only to make files usable in older versions. */ SEQ_time_update_meta_strip_range(scene, seq_sequence_lookup_meta_by_seq(scene, seq)); @@ -538,14 +542,13 @@ void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int val) void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int val) { - const float strip_content_end_frame = seq->start + SEQ_time_strip_length_get(scene, seq); const float left_handle_orig_frame = SEQ_time_left_handle_frame_get(scene, seq); if (val <= left_handle_orig_frame) { val = left_handle_orig_frame + 1; } - seq->endofs = strip_content_end_frame - val; + seq->endofs = SEQ_time_content_end_frame_get(scene, seq) - val; seq->enddisp = val; /* Only to make files usable in older versions. */ SEQ_time_update_meta_strip_range(scene, seq_sequence_lookup_meta_by_seq(scene, seq)); |