diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-08 16:55:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-08 16:55:31 +0300 |
commit | ec7df03c867d28316708e9b91bec5cef0aee832e (patch) | |
tree | 3f560939b745032e235d9ac789c4117d669d6462 /source/blender/editors/space_sequencer | |
parent | 4c318539b2f6abdf8f2a02376b6fcb8d30a4b12e (diff) |
Warning fixes, one actual bug found in sequencer sound wave drawing. Also
changed some malloc to MEM_mallocN while trying to track down a memory leak.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 5339acf74d9..0955652c30f 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -186,12 +186,12 @@ static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, f int length = floor((x2-x1)/stepsize)+1; float ymid = (y1+y2)/2; float yscale = (y2-y1)/2; - float* samples = malloc(length * sizeof(float) * 2); + float* samples = MEM_mallocN(length * sizeof(float) * 2, "seqwave_samples"); if(!samples) return; if(sound_read_sound_buffer(seq->sound, samples, length) != length) { - free(samples); + MEM_freeN(samples); return; } glBegin(GL_LINES); @@ -201,7 +201,7 @@ static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, f glVertex2f(x1+i*stepsize, ymid + samples[i * 2 + 1] * yscale); } glEnd(); - free(samples); + MEM_freeN(samples); } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 4f19cfa86af..11bdbcb5314 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2223,11 +2223,13 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) /* view_all operator */ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); bScreen *sc= CTX_wm_screen(C); ScrArea *area= CTX_wm_area(C); +#if 0 ARegion *ar= CTX_wm_region(C); SpaceSeq *sseq= area->spacedata.first; + Scene *scene= CTX_data_scene(C); +#endif View2D *v2d= UI_view2d_fromcontext(C); v2d->cur= v2d->tot; @@ -2528,6 +2530,7 @@ static void swap_sequence(Scene* scene, Sequence* seqa, Sequence* seqb) calc_sequence(scene, seqa); } +#if 0 static Sequence* sequence_find_parent(Scene* scene, Sequence* child) { Editing *ed= seq_give_editing(scene, FALSE); @@ -2542,9 +2545,10 @@ static Sequence* sequence_find_parent(Scene* scene, Sequence* child) break; } } - return parent; + return parent; } +#endif static int sequencer_swap_exec(bContext *C, wmOperator *op) { |