diff options
Diffstat (limited to 'source/blender/sequencer')
-rw-r--r-- | source/blender/sequencer/SEQ_proxy.h | 3 | ||||
-rw-r--r-- | source/blender/sequencer/intern/proxy.c | 6 | ||||
-rw-r--r-- | source/blender/sequencer/intern/sound.c | 9 |
3 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/sequencer/SEQ_proxy.h b/source/blender/sequencer/SEQ_proxy.h index 7bfe932ff1c..164b279245c 100644 --- a/source/blender/sequencer/SEQ_proxy.h +++ b/source/blender/sequencer/SEQ_proxy.h @@ -42,7 +42,8 @@ bool SEQ_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq, struct GSet *file_list, - struct ListBase *queue); + struct ListBase *queue, + bool build_only_on_bad_performance); void SEQ_proxy_rebuild(struct SeqIndexBuildContext *context, short *stop, short *do_update, diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index cc0ea0634a3..5982f89a287 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -415,7 +415,8 @@ bool SEQ_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *seq, struct GSet *file_list, - ListBase *queue) + ListBase *queue, + bool build_only_on_bad_performance) { SeqIndexBuildContext *context; Sequence *nseq; @@ -476,7 +477,8 @@ bool SEQ_proxy_rebuild_context(Main *bmain, context->size_flags, context->quality, context->overwrite, - file_list); + file_list, + build_only_on_bad_performance); } if (!context->index_context) { MEM_freeN(context); diff --git a/source/blender/sequencer/intern/sound.c b/source/blender/sequencer/intern/sound.c index 86a37aca4a9..0788003fb12 100644 --- a/source/blender/sequencer/intern/sound.c +++ b/source/blender/sequencer/intern/sound.c @@ -31,6 +31,7 @@ #include "DNA_sound_types.h" #include "BLI_listbase.h" +#include "BLI_utildefines.h" #include "BKE_main.h" #include "BKE_scene.h" @@ -56,11 +57,15 @@ static bool sequencer_refresh_sound_length_recursive(Main *bmain, Scene *scene, } } else if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound) { - const float length = BKE_sound_get_length(bmain, seq->sound); + SoundInfo info; + if (!BKE_sound_info_get(bmain, seq->sound, &info)) { + continue; + } + int old = seq->len; float fac; - seq->len = (int)ceil((double)length * FPS); + seq->len = MAX2(1, round((info.length - seq->sound->offset_time) * FPS)); fac = (float)seq->len / (float)old; old = seq->startofs; seq->startofs *= fac; |