diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-26 19:57:00 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-26 19:57:00 +0400 |
commit | adbe628a1b6dfe4f61ce56fede9cc9ebba19caa7 (patch) | |
tree | 00eaa7d02e2736fda6214421ead71ef559f07cca /source/blender/blenkernel | |
parent | 3d5111a5edba9e0e4947aba866cba083a20853a0 (diff) |
Fix crash of Refresh Sequencer when some Movie / MovieClip strips doesn't have animation opened
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 28 |
3 files changed, 46 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 7a84e71c763..8f53dc041a3 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -348,4 +348,6 @@ extern SequencerDrawView sequencer_view3d_cb; extern ListBase seqbase_clipboard; extern int seqbase_clipboard_frame; +void seq_update_sequence_length(struct Scene *scene, struct Editing *ed, struct Sequence *seq); + #endif // __BKE_SEQUENCER_H__ diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 55f257e0feb..e375262c045 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -213,11 +213,8 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user, return ibuf; } -static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag) +static void movieclip_open_anim_file(MovieClip *clip) { - ImBuf *ibuf = NULL; - int tc = get_timecode(clip, flag); - int proxy = rendersize_to_proxy(user, flag); char str[FILE_MAX]; if (!clip->anim) { @@ -236,6 +233,15 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in } } } +} + +static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag) +{ + ImBuf *ibuf = NULL; + int tc = get_timecode(clip, flag); + int proxy = rendersize_to_proxy(user, flag); + + movieclip_open_anim_file(clip); if (clip->anim) { int dur; @@ -258,8 +264,12 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in static void movieclip_calc_length(MovieClip *clip) { - if (clip->anim) { - clip->len = IMB_anim_get_duration(clip->anim, clip->proxy.tc); + if (clip->source == MCLIP_SRC_MOVIE) { + movieclip_open_anim_file(clip); + + if (clip->anim) { + clip->len = IMB_anim_get_duration(clip->anim, clip->proxy.tc); + } } else if (clip->source == MCLIP_SRC_SEQUENCE) { int framenr = 1; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 18749d7b5a6..94069f94f4d 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -4007,3 +4007,31 @@ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase, } } } + +void seq_update_sequence_length(Scene *scene, Editing *ed, Sequence *seq) +{ + int changed = FALSE; + + switch (seq->type) { + case SEQ_SCENE: + seq->len = seq->scene->r.efra - seq->scene->r.sfra + 1; + changed = TRUE; + break; + case SEQ_MOVIECLIP: + seq->len = BKE_movieclip_get_duration(seq->clip); + changed = TRUE; + break; + case SEQ_MOVIE: + seq_open_anim_file(seq); + seq->len = IMB_anim_get_duration(seq->anim, IMB_TC_RECORD_RUN); + changed = TRUE; + break; + } + + if (changed) { + calc_sequence_disp(scene, seq); + + if (seq_test_overlap(ed->seqbasep, seq)) + shuffle_seq(ed->seqbasep, seq, scene); + } +} |