Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c19
-rw-r--r--source/blender/sequencer/SEQ_time.h1
-rw-r--r--source/blender/sequencer/intern/strip_time.c9
3 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 75cf8542f67..4b26469aad3 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2934,6 +2934,23 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
/** \name Export Subtitles Operator
* \{ */
+/** Comparison function suitable to be used with BLI_listbase_sort(). */
+static int seq_cmp_time_startdisp_channel(const void *a, const void *b)
+{
+ Sequence *seq_a = (Sequence *)a;
+ Sequence *seq_b = (Sequence *)b;
+
+ int seq_a_start = SEQ_transform_get_left_handle_frame(seq_a);
+ int seq_b_start = SEQ_transform_get_left_handle_frame(seq_b);
+
+ /** If strips have the same start frame favor the one with a higher channel. **/
+ if (seq_a_start == seq_b_start) {
+ return seq_a->machine > seq_b->machine;
+ }
+
+ return (seq_a_start > seq_b_start);
+}
+
static int sequencer_export_subtitles_invoke(bContext *C,
wmOperator *op,
const wmEvent *UNUSED(event))
@@ -3003,7 +3020,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- BLI_listbase_sort(&text_seq, SEQ_time_cmp_time_startdisp);
+ BLI_listbase_sort(&text_seq, seq_cmp_time_startdisp_channel);
/* Open and write file. */
file = BLI_fopen(filepath, "w");
diff --git a/source/blender/sequencer/SEQ_time.h b/source/blender/sequencer/SEQ_time.h
index 593a8fe7bf2..732e9bb985a 100644
--- a/source/blender/sequencer/SEQ_time.h
+++ b/source/blender/sequencer/SEQ_time.h
@@ -44,7 +44,6 @@ int SEQ_time_find_next_prev_edit(struct Scene *scene,
const bool do_unselected);
void SEQ_time_update_sequence(struct Scene *scene, struct Sequence *seq);
void SEQ_time_update_sequence_bounds(struct Scene *scene, struct Sequence *seq);
-int SEQ_time_cmp_time_startdisp(const void *a, const void *b);
bool SEQ_time_strip_intersects_frame(const struct Sequence *seq, const int timeline_frame);
void SEQ_time_update_meta_strip_range(struct Scene *scene, struct Sequence *seq_meta);
diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c
index ecd6b0c833d..20e2421ea88 100644
--- a/source/blender/sequencer/intern/strip_time.c
+++ b/source/blender/sequencer/intern/strip_time.c
@@ -257,15 +257,6 @@ void SEQ_time_update_sequence(Scene *scene, Sequence *seq)
}
}
-/** Comparison function suitable to be used with BLI_listbase_sort()... */
-int SEQ_time_cmp_time_startdisp(const void *a, const void *b)
-{
- const Sequence *seq_a = a;
- const Sequence *seq_b = b;
-
- return (seq_a->startdisp > seq_b->startdisp);
-}
-
int SEQ_time_find_next_prev_edit(Scene *scene,
int timeline_frame,
const short side,