From c826566ce341cfa6bb02c733a5c70e26542bee9e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2015 03:28:43 +1000 Subject: Sound now returns even if file fails to load With various codecs its hard to ensure a sound will load or not. --- source/blender/makesrna/intern/rna_sequencer_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 881688281f3..44169fa641e 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -232,7 +232,8 @@ static Sequence *rna_Sequences_new_sound(ID *id, Editing *ed, Main *bmain, Repor bSound *sound = BKE_sound_new_file(bmain, file); - if (sound == NULL || sound->playback_handle == NULL) { + if (sound->playback_handle == NULL) { + BKE_libblock_free(bmain, sound); BKE_report(reports, RPT_ERROR, "Sequences.new_sound: unable to open sound file"); return NULL; } -- cgit v1.2.3