mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Fix SDL deprecations
This commit is contained in:
parent
0c05aa2eff
commit
a7a260be16
1 changed files with 5 additions and 5 deletions
|
@ -95,24 +95,24 @@ impl Sink for SdlSink {
|
||||||
let samples = packet
|
let samples = packet
|
||||||
.samples()
|
.samples()
|
||||||
.map_err(|e| SinkError::OnWrite(e.to_string()))?;
|
.map_err(|e| SinkError::OnWrite(e.to_string()))?;
|
||||||
match self {
|
let result = match self {
|
||||||
Self::F32(queue) => {
|
Self::F32(queue) => {
|
||||||
let samples_f32: &[f32] = &converter.f64_to_f32(samples);
|
let samples_f32: &[f32] = &converter.f64_to_f32(samples);
|
||||||
drain_sink!(queue, AudioFormat::F32.size());
|
drain_sink!(queue, AudioFormat::F32.size());
|
||||||
queue.queue(samples_f32)
|
queue.queue_audio(samples_f32)
|
||||||
}
|
}
|
||||||
Self::S32(queue) => {
|
Self::S32(queue) => {
|
||||||
let samples_s32: &[i32] = &converter.f64_to_s32(samples);
|
let samples_s32: &[i32] = &converter.f64_to_s32(samples);
|
||||||
drain_sink!(queue, AudioFormat::S32.size());
|
drain_sink!(queue, AudioFormat::S32.size());
|
||||||
queue.queue(samples_s32)
|
queue.queue_audio(samples_s32)
|
||||||
}
|
}
|
||||||
Self::S16(queue) => {
|
Self::S16(queue) => {
|
||||||
let samples_s16: &[i16] = &converter.f64_to_s16(samples);
|
let samples_s16: &[i16] = &converter.f64_to_s16(samples);
|
||||||
drain_sink!(queue, AudioFormat::S16.size());
|
drain_sink!(queue, AudioFormat::S16.size());
|
||||||
queue.queue(samples_s16)
|
queue.queue_audio(samples_s16)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ok(())
|
result.map_err(SinkError::OnWrite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue