From a7a260be1656ce1bc8a5e00e38a99d27ca63e400 Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Thu, 7 Apr 2022 23:20:49 +0200 Subject: [PATCH] Fix SDL deprecations --- playback/src/audio_backend/sdl.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/playback/src/audio_backend/sdl.rs b/playback/src/audio_backend/sdl.rs index 1c9794a2..4e390262 100644 --- a/playback/src/audio_backend/sdl.rs +++ b/playback/src/audio_backend/sdl.rs @@ -95,24 +95,24 @@ impl Sink for SdlSink { let samples = packet .samples() .map_err(|e| SinkError::OnWrite(e.to_string()))?; - match self { + let result = match self { Self::F32(queue) => { let samples_f32: &[f32] = &converter.f64_to_f32(samples); drain_sink!(queue, AudioFormat::F32.size()); - queue.queue(samples_f32) + queue.queue_audio(samples_f32) } Self::S32(queue) => { let samples_s32: &[i32] = &converter.f64_to_s32(samples); drain_sink!(queue, AudioFormat::S32.size()); - queue.queue(samples_s32) + queue.queue_audio(samples_s32) } Self::S16(queue) => { let samples_s16: &[i16] = &converter.f64_to_s16(samples); drain_sink!(queue, AudioFormat::S16.size()); - queue.queue(samples_s16) + queue.queue_audio(samples_s16) } }; - Ok(()) + result.map_err(SinkError::OnWrite) } }