mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #1013 from JasonLG1979/minor-alsa-tweaks
Minor alsa backend tweaks
This commit is contained in:
commit
cbba7abd38
1 changed files with 2 additions and 3 deletions
|
@ -6,7 +6,6 @@ use crate::{NUM_CHANNELS, SAMPLE_RATE};
|
|||
use alsa::device_name::HintIter;
|
||||
use alsa::pcm::{Access, Format, Frames, HwParams, PCM};
|
||||
use alsa::{Direction, ValueOr};
|
||||
use std::cmp::min;
|
||||
use std::process::exit;
|
||||
use thiserror::Error;
|
||||
|
||||
|
@ -141,7 +140,7 @@ fn list_compatible_devices() -> SinkResult<()> {
|
|||
|
||||
println!(
|
||||
"\tDescription:\n\n\t\t{}\n",
|
||||
a.desc.unwrap_or_default().replace("\n", "\n\t\t")
|
||||
a.desc.unwrap_or_default().replace('\n', "\n\t\t")
|
||||
);
|
||||
|
||||
println!(
|
||||
|
@ -467,7 +466,7 @@ impl SinkAsBytes for AlsaSink {
|
|||
loop {
|
||||
let data_left = data_len - start_index;
|
||||
let space_left = capacity - self.period_buffer.len();
|
||||
let data_to_buffer = min(data_left, space_left);
|
||||
let data_to_buffer = data_left.min(space_left);
|
||||
let end_index = start_index + data_to_buffer;
|
||||
|
||||
self.period_buffer
|
||||
|
|
Loading…
Reference in a new issue