main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
3 changed files with 3 additions and 13 deletions
Showing only changes of commit cf39e077b3 - Show all commits

View File

@ -99,7 +99,7 @@ void SEQ_retiming_data_ensure(Sequence *seq)
seq->retiming_handles = (SeqRetimingHandle *)MEM_calloc_arrayN( seq->retiming_handles = (SeqRetimingHandle *)MEM_calloc_arrayN(
2, sizeof(SeqRetimingHandle), __func__); 2, sizeof(SeqRetimingHandle), __func__);
SeqRetimingHandle *handle = seq->retiming_handles + 1; SeqRetimingHandle *handle = seq->retiming_handles + 1;
handle->strip_frame_index = seq_time_strip_original_content_length_get(seq) - 1; handle->strip_frame_index = seq->len;
handle->retiming_factor = 1.0f; handle->retiming_factor = 1.0f;
seq->retiming_handle_num = 2; seq->retiming_handle_num = 2;
} }
@ -232,7 +232,7 @@ float SEQ_retiming_handle_speed_get(const Sequence *seq, const SeqRetimingHandle
const SeqRetimingHandle *handle_prev = handle - 1; const SeqRetimingHandle *handle_prev = handle - 1;
const int frame_index_max = seq_time_strip_original_content_length_get(seq) - 1; const int frame_index_max = seq->len - 1;
const int frame_retimed_prev = round_fl_to_int(handle_prev->retiming_factor * frame_index_max); const int frame_retimed_prev = round_fl_to_int(handle_prev->retiming_factor * frame_index_max);
const int frame_index_prev = handle_prev->strip_frame_index; const int frame_index_prev = handle_prev->strip_frame_index;
const int frame_retimed = round_fl_to_int(handle->retiming_factor * frame_index_max); const int frame_retimed = round_fl_to_int(handle->retiming_factor * frame_index_max);

View File

@ -53,21 +53,12 @@ float seq_time_media_playback_rate_factor_get(const Scene *scene, const Sequence
return seq->media_playback_rate / scene_playback_rate; return seq->media_playback_rate / scene_playback_rate;
} }
int seq_time_strip_original_content_length_get(const Sequence *seq)
{
if (seq->type == SEQ_TYPE_SOUND_RAM) {
return seq->len;
}
return seq->len;
}
float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_frame) float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_frame)
{ {
float frame_index; float frame_index;
float sta = SEQ_time_start_frame_get(seq); float sta = SEQ_time_start_frame_get(seq);
float end = SEQ_time_content_end_frame_get(scene, seq) - 1; float end = SEQ_time_content_end_frame_get(scene, seq) - 1;
const float length = seq_time_strip_original_content_length_get(seq); const float length = seq->len;
if (seq->type & SEQ_TYPE_EFFECT) { if (seq->type & SEQ_TYPE_EFFECT) {
end = SEQ_time_right_handle_frame_get(scene, seq); end = SEQ_time_right_handle_frame_get(scene, seq);

View File

@ -43,7 +43,6 @@ void seq_time_update_effects_strip_range(const struct Scene *scene, struct SeqCo
void seq_time_translate_handles(const struct Scene *scene, struct Sequence *seq, const int offset); void seq_time_translate_handles(const struct Scene *scene, struct Sequence *seq, const int offset);
float seq_time_media_playback_rate_factor_get(const struct Scene *scene, float seq_time_media_playback_rate_factor_get(const struct Scene *scene,
const struct Sequence *seq); const struct Sequence *seq);
int seq_time_strip_original_content_length_get(const struct Sequence *seq);
float seq_retiming_evaluate(const struct Sequence *seq, const int frame_index); float seq_retiming_evaluate(const struct Sequence *seq, const int frame_index);
#ifdef __cplusplus #ifdef __cplusplus