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
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2019-05-31 01:19:02 +0300
committerRichard Antalik <richardantalik@gmail.com>2019-05-31 01:47:25 +0300
commit7ccc7ef61fde38e517d730cef05242cc150126d1 (patch)
tree22a7eb694b7c96c3deb115595fec379d146a522f /source/blender/blenkernel/intern/sequencer.c
parentfc336f973d521e61ad6c10fbd67a72d684dbe43a (diff)
VSE: don't add crop and transform data for sound strips
This also fixes commit rB1fd7b380f4cf8a0489b405de2819f228a4da5ea2 which didn't do allocation for effect strips properly. Reviewed By: brecht, campbellbarton Differential Revision: https://developer.blender.org/D4970
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 827d7343aad..ec8a2520461 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -5353,16 +5353,20 @@ static void seq_load_apply(Main *bmain, Scene *scene, Sequence *seq, SeqLoadInfo
}
}
-static Strip *seq_strip_alloc(void)
+static Strip *seq_strip_alloc(int type)
{
Strip *strip = MEM_callocN(sizeof(Strip), "strip");
- strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
- strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
+ if (ELEM(type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) == 0) {
+ strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
+ strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
+ }
+
+ strip->us = 1;
return strip;
}
-Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine)
+Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine, int type)
{
Sequence *seq;
@@ -5381,7 +5385,9 @@ Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine)
seq->volume = 1.0f;
seq->pitch = 1.0f;
seq->scene_sound = NULL;
+ seq->type = type;
+ seq->strip = seq_strip_alloc(type);
seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format");
seq->cache_flag = SEQ_CACHE_ALL_TYPES;
@@ -5465,15 +5471,13 @@ Sequence *BKE_sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoad
Sequence *seq;
Strip *strip;
- seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel);
- seq->type = SEQ_TYPE_IMAGE;
+ seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel, SEQ_TYPE_IMAGE);
seq->blend_mode = SEQ_TYPE_ALPHAOVER;
/* basic defaults */
- seq->strip = strip = seq_strip_alloc();
-
seq->len = seq_load->len ? seq_load->len : 1;
- strip->us = 1;
+
+ strip = seq->strip;
strip->stripdata = MEM_callocN(seq->len * sizeof(StripElem), "stripelem");
BLI_strncpy(strip->dir, seq_load->path, sizeof(strip->dir));
@@ -5517,19 +5521,16 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
return NULL;
}
- seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel);
-
- seq->type = SEQ_TYPE_SOUND_RAM;
+ seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel, SEQ_TYPE_SOUND_RAM);
seq->sound = sound;
BLI_strncpy(seq->name + 2, "Sound", SEQ_NAME_MAXSTR - 2);
BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq);
/* basic defaults */
- seq->strip = strip = seq_strip_alloc();
/* We add a very small negative offset here, because
* ceil(132.0) == 133.0, not nice with videos, see T47135. */
seq->len = (int)ceil((double)info.length * FPS - 1e-4);
- strip->us = 1;
+ strip = seq->strip;
/* we only need 1 element to store the filename */
strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem");
@@ -5622,7 +5623,7 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
}
}
- seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel);
+ seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel, SEQ_TYPE_MOVIE);
/* multiview settings */
if (seq_load->stereo3d_format) {
@@ -5630,8 +5631,6 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
seq->views_format = seq_load->views_format;
}
seq->flag |= seq_load->flag & SEQ_USE_VIEWS;
-
- seq->type = SEQ_TYPE_MOVIE;
seq->blend_mode = SEQ_TYPE_ALPHAOVER;
for (i = 0; i < totfiles; i++) {
@@ -5657,9 +5656,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
}
/* basic defaults */
- seq->strip = strip = seq_strip_alloc();
seq->len = IMB_anim_get_duration(anim_arr[0], IMB_TC_RECORD_RUN);
- strip->us = 1;
+ strip = seq->strip;
BLI_strncpy(seq->strip->colorspace_settings.name,
colorspace,