diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-15 14:28:08 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-15 16:00:51 +0300 |
commit | b41ce0d1b95973c64bb4300a20c1b89506fe32d0 (patch) | |
tree | 7bdab570c8c2d8baf5ea9286c203fefa7ff864f1 | |
parent | 588656a568a837d3d043c91b684ebbe2a006b2af (diff) |
Remove 'locked' parameter from sound_read_waveform()
This parameter was confusing in three ways:
1. It should have been named "lock" because it was used to take and
release the sound mutex, not to indicate whether it was locked.
2. In the one place this function gets called the locked argument was
set to "true", so not much point in having it optional.
3. I can't imagine that it would ever be a good idea to skip taking
and releasing the mutex.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D988
-rw-r--r-- | source/blender/blenkernel/BKE_sound.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_preview.c | 2 |
3 files changed, 8 insertions, 12 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index f318c74258b..a4182b8405f 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -130,7 +130,7 @@ int sound_scene_playing(struct Scene *scene); void sound_free_waveform(struct bSound *sound); -void sound_read_waveform(struct bSound *sound, bool locked, short *stop); +void sound_read_waveform(struct bSound *sound, short *stop); void sound_update_scene(struct Main *bmain, struct Scene *scene); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3c7b01f9052..5c5b2cc02c5 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -681,7 +681,7 @@ void sound_free_waveform(bSound *sound) sound->waveform = NULL; } -void sound_read_waveform(bSound *sound, bool locked, short *stop) +void sound_read_waveform(bSound *sound, short *stop) { AUD_SoundInfo info; SoundWaveform *waveform = NULL; @@ -698,23 +698,19 @@ void sound_read_waveform(bSound *sound, bool locked, short *stop) if (*stop) { MEM_freeN(waveform->data); MEM_freeN(waveform); - if (locked) - BLI_mutex_lock(sound->mutex); + BLI_mutex_lock(sound->mutex); sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING; - if (locked) - BLI_mutex_unlock(sound->mutex); + BLI_mutex_unlock(sound->mutex); return; } sound_free_waveform(sound); } - if (locked) - BLI_mutex_lock(sound->mutex); + BLI_mutex_lock(sound->mutex); sound->waveform = waveform; sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING; - if (locked) - BLI_mutex_unlock(sound->mutex); + BLI_mutex_unlock(sound->mutex); } void sound_update_scene(Main *bmain, struct Scene *scene) @@ -849,7 +845,7 @@ void sound_stop_scene(struct Scene *UNUSED(scene)) {} void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {} float sound_sync_scene(struct Scene *UNUSED(scene)) { return NAN_FLT; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } -void sound_read_waveform(struct bSound *sound, bool locked, short *stop) { UNUSED_VARS(sound, locked, stop); } +void sound_read_waveform(struct bSound *sound, short *stop) { UNUSED_VARS(sound, stop); } void sound_init_main(struct Main *UNUSED(bmain)) {} void sound_set_cfra(int UNUSED(cfra)) {} void sound_update_sequencer(struct Main *UNUSED(main), struct bSound *UNUSED(sound)) {} diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index dd6349efb8f..da00b0ff6e1 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -85,7 +85,7 @@ static void preview_startjob(void *data, short *stop, short *do_update, float *p PreviewJobAudio *preview_next; bSound *sound = previewjb->sound; - sound_read_waveform(sound, true, stop); + sound_read_waveform(sound, stop); if (*stop || G.is_break) { BLI_mutex_lock(pj->mutex); |