Skip to content

Commit 1b18e1c

Browse files
committed
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.
1 parent 3de6172 commit 1b18e1c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sdl2/audio.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,8 @@ impl AudioCVT {
10041004
pub fn convert(&self, mut src: Vec<u8>) -> Vec<u8> {
10051005
//! Convert audio data to a desired audio format.
10061006
//!
1007-
//! The `src` vector is adjusted to the capacity necessary to perform
1008-
//! the conversion in place; then it is passed to the SDL library.
1009-
//!
1010-
//! Certain conversions may cause buffer overflows. See AngryLawyer/rust-sdl2 issue #270.
1007+
//! Passes raw audio data from src to the SDL library for conversion, returning the result
1008+
//! of the conversion.
10111009
unsafe {
10121010
if self.raw.needed != 0 {
10131011
use std::convert::TryInto;

0 commit comments

Comments
 (0)