diff --git a/src/sdl2/mixer/mod.rs b/src/sdl2/mixer/mod.rs index 728e1a0c..7afb91fe 100644 --- a/src/sdl2/mixer/mod.rs +++ b/src/sdl2/mixer/mod.rs @@ -232,10 +232,9 @@ impl Drop for Chunk { fn drop(&mut self) { if self.owned { unsafe { - // Mix_QuickLoad_* functions don't set the allocated flag, but - // from_wav_buffer and from_raw_buffer *do* take ownership of the data, - // so we need to deallocate the buffers here, because Mix_FreeChunk won't - // and we'd be leaking memory otherwise. + // Mix_QuickLoad_* functions don't set the allocated flag, but from_raw_buffer + // *does* take ownership of the data, so we need to deallocate the buffers here, + // because Mix_FreeChunk won't and we'd be leaking memory otherwise. if (*self.raw).allocated == 0 { drop(Box::from_raw((*self.raw).abuf)); } @@ -252,13 +251,6 @@ impl Chunk { Self::from_owned_raw(raw) } - /// Get chunk based on a buffer containing WAV data in the mixer format. The chunk takes - /// ownership of the buffer. - pub fn from_wav_buffer(buffer: Box<[u8]>) -> Result { - let raw = unsafe { mixer::Mix_QuickLoad_WAV(Box::into_raw(buffer) as *mut u8) }; - Self::from_owned_raw(raw) - } - /// Load chunk from a buffer containing raw audio data in the mixer format. The length of the /// buffer has to fit in 32-bit unsigned integer. The chunk takes ownership of the buffer. ///