mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 18:29:45 +02:00
minor cleanup
This commit is contained in:
parent
9d77fef008
commit
6a33eb4efa
27 changed files with 172 additions and 212 deletions
|
@ -2,9 +2,10 @@ use super::{Open, Sink};
|
|||
use crate::audio::AudioPacket;
|
||||
use gst::prelude::*;
|
||||
use gst::*;
|
||||
use zerocopy::*;
|
||||
|
||||
use std::sync::mpsc::{sync_channel, SyncSender};
|
||||
use std::{io, thread};
|
||||
use zerocopy::*;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct GstreamerSink {
|
||||
|
@ -91,10 +92,7 @@ impl Open for GstreamerSink {
|
|||
.set_state(gst::State::Playing)
|
||||
.expect("Unable to set the pipeline to the `Playing` state");
|
||||
|
||||
GstreamerSink {
|
||||
tx: tx,
|
||||
pipeline: pipeline,
|
||||
}
|
||||
GstreamerSink { tx, pipeline }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ impl Open for JackSink {
|
|||
|
||||
JackSink {
|
||||
send: tx,
|
||||
active_client: active_client,
|
||||
active_client,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ use self::pipe::StdoutSink;
|
|||
mod subprocess;
|
||||
use self::subprocess::SubprocessSink;
|
||||
|
||||
pub const BACKENDS: &'static [(&'static str, SinkBuilder)] = &[
|
||||
pub const BACKENDS: &[(&str, SinkBuilder)] = &[
|
||||
#[cfg(feature = "alsa-backend")]
|
||||
("alsa", mk_sink::<AlsaSink>),
|
||||
#[cfg(feature = "portaudio-backend")]
|
||||
|
|
|
@ -26,8 +26,8 @@ impl Open for PulseAudioSink {
|
|||
|
||||
PulseAudioSink {
|
||||
s: None,
|
||||
ss: ss,
|
||||
device: device,
|
||||
ss,
|
||||
device,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ pub enum RodioError {
|
|||
|
||||
pub struct RodioSink {
|
||||
rodio_sink: rodio::Sink,
|
||||
|
||||
// will produce a TryRecvError on the receiver side when it is dropped.
|
||||
_close_tx: mpsc::SyncSender<Infallible>,
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl Open for SdlSink {
|
|||
.open_queue(None, &desired_spec)
|
||||
.expect("Could not open SDL audio device");
|
||||
|
||||
SdlSink { queue: queue }
|
||||
SdlSink { queue }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
use super::{Open, Sink};
|
||||
use crate::audio::AudioPacket;
|
||||
|
||||
use shell_words::split;
|
||||
|
||||
use std::io::{self, Write};
|
||||
use std::mem;
|
||||
use std::process::{Child, Command, Stdio};
|
||||
|
@ -15,7 +17,7 @@ impl Open for SubprocessSink {
|
|||
fn open(shell_command: Option<String>) -> SubprocessSink {
|
||||
if let Some(shell_command) = shell_command {
|
||||
SubprocessSink {
|
||||
shell_command: shell_command,
|
||||
shell_command,
|
||||
child: None,
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue