Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 53d6d8b5d10..7e7cc8745fd 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -123,17 +123,8 @@ bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepath)
return BKE_sound_new_file_exists_ex(bmain, filepath, NULL);
}
-/**
- * Free (or release) any data used by this sound (does not free the sound itself).
- *
- * \param sound The sound to free.
- * \param do_id_user When \a true, ID datablocks used (referenced) by this sound are 'released'
- * (their user count is decreased).
- */
-void BKE_sound_free(bSound *sound, const bool UNUSED(do_id_user))
+void BKE_sound_free(bSound *sound)
{
- /* No animdata here. */
-
if (sound->packedfile) {
freePackedFile(sound->packedfile);
sound->packedfile = NULL;
@@ -157,7 +148,8 @@ void BKE_sound_free(bSound *sound, const bool UNUSED(do_id_user))
BLI_spin_end(sound->spinlock);
MEM_freeN(sound->spinlock);
sound->spinlock = NULL;
- }
+ }
+
#endif /* WITH_AUDASPACE */
}
@@ -323,6 +315,15 @@ bSound *BKE_sound_new_limiter(struct Main *bmain, bSound *source, float start, f
}
#endif
+void BKE_sound_delete(struct Main *bmain, bSound *sound)
+{
+ if (sound) {
+ BKE_sound_free(sound);
+
+ BKE_libblock_free(bmain, sound);
+ }
+}
+
void BKE_sound_cache(bSound *sound)
{
sound->flags |= SOUND_FLAGS_CACHING;