"Fix" aka implementation of [#21548] Audio doesn't work when adding scenes with audio to another scene.
This commit is contained in:
@@ -72,6 +72,8 @@ void sound_create_scene(struct Scene *scene);
|
||||
|
||||
void sound_destroy_scene(struct Scene *scene);
|
||||
|
||||
void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
|
||||
|
||||
void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip);
|
||||
|
||||
void sound_remove_scene_sound(struct Scene *scene, void* handle);
|
||||
|
||||
@@ -3698,7 +3698,7 @@ static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequen
|
||||
|
||||
seq_update_muting_recursive(scene, &seq->seqbase, metaseq, seqmute);
|
||||
}
|
||||
else if(seq->type == SEQ_SOUND) {
|
||||
else if((seq->type == SEQ_SOUND) || (seq->type == SEQ_SCENE)) {
|
||||
if(seq->scene_sound) {
|
||||
sound_mute_scene_sound(scene, seq->scene_sound, seqmute);
|
||||
}
|
||||
|
||||
@@ -349,6 +349,11 @@ void sound_destroy_scene(struct Scene *scene)
|
||||
AUD_destroySequencer(scene->sound_scene);
|
||||
}
|
||||
|
||||
void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
|
||||
{
|
||||
return AUD_addSequencer(scene->sound_scene, &(sequence->scene->sound_scene), startframe / FPS, endframe / FPS, frameskip / FPS, sequence);
|
||||
}
|
||||
|
||||
void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip)
|
||||
{
|
||||
return AUD_addSequencer(scene->sound_scene, &(sequence->sound->playback_handle), startframe / FPS, endframe / FPS, frameskip / FPS, sequence);
|
||||
|
||||
@@ -4143,7 +4143,10 @@ static void lib_link_scene(FileData *fd, Main *main)
|
||||
|
||||
SEQ_BEGIN(sce->ed, seq) {
|
||||
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
|
||||
if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
|
||||
if(seq->scene) {
|
||||
seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
|
||||
seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
|
||||
}
|
||||
if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
|
||||
if(seq->sound) {
|
||||
seq->scene_sound = NULL;
|
||||
|
||||
@@ -215,6 +215,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
|
||||
else
|
||||
strcpy(seq->name+2, sce_seq->id.name+2);
|
||||
|
||||
seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);
|
||||
|
||||
calc_sequence_disp(scene, seq);
|
||||
sort_seq(scene);
|
||||
|
||||
|
||||
@@ -828,6 +828,8 @@ static Sequence *dupli_seq(struct Scene *scene, Sequence *seq)
|
||||
/* - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);*/
|
||||
} else if(seq->type == SEQ_SCENE) {
|
||||
seqn->strip->stripdata = 0;
|
||||
if(seq->scene_sound)
|
||||
seqn->scene_sound = sound_scene_add_scene_sound(scene, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
|
||||
} else if(seq->type == SEQ_MOVIE) {
|
||||
seqn->strip->stripdata =
|
||||
MEM_dupallocN(seq->strip->stripdata);
|
||||
|
||||
Reference in New Issue
Block a user