From 1b18e1ca773cbe3ee458534e008f13b558750d4b Mon Sep 17 00:00:00 2001 From: Mike Waychison Date: Thu, 22 Apr 2021 10:15:42 -0700 Subject: [PATCH] Update doc for AudioCVT::convert Update to reflect the surface interface and remove the bits about conversion in place which are now out of date. This also removes the note about buffer overflows in issue #270. Looking back, the understanding was that the buffer wouldn't get reallocated, and this is evident even in the sample C code used there. --- src/sdl2/audio.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sdl2/audio.rs b/src/sdl2/audio.rs index 754ec027..07dd6d3b 100644 --- a/src/sdl2/audio.rs +++ b/src/sdl2/audio.rs @@ -1004,10 +1004,8 @@ impl AudioCVT { pub fn convert(&self, mut src: Vec) -> Vec { //! Convert audio data to a desired audio format. //! - //! The `src` vector is adjusted to the capacity necessary to perform - //! the conversion in place; then it is passed to the SDL library. - //! - //! Certain conversions may cause buffer overflows. See AngryLawyer/rust-sdl2 issue #270. + //! Passes raw audio data from src to the SDL library for conversion, returning the result + //! of the conversion. unsafe { if self.raw.needed != 0 { use std::convert::TryInto;