|
@@ -16,15 +16,13 @@ impl Open for AlsaSink {
|
|
|
|
|
|
impl Sink for AlsaSink {
|
|
impl Sink for AlsaSink {
|
|
fn start(&mut self) -> io::Result<()> {
|
|
fn start(&mut self) -> io::Result<()> {
|
|
- if self.0.is_some() {
|
|
|
|
- } else {
|
|
|
|
|
|
+ if self.0.is_none() {
|
|
match PCM::open(&*self.1,
|
|
match PCM::open(&*self.1,
|
|
Stream::Playback, Mode::Blocking,
|
|
Stream::Playback, Mode::Blocking,
|
|
Format::Signed16, Access::Interleaved,
|
|
Format::Signed16, Access::Interleaved,
|
|
2, 44100) {
|
|
2, 44100) {
|
|
Ok(f) => self.0 = Some(f),
|
|
Ok(f) => self.0 = Some(f),
|
|
Err(e) => {
|
|
Err(e) => {
|
|
- self.0 = None;
|
|
|
|
error!("Alsa error PCM open {}", e);
|
|
error!("Alsa error PCM open {}", e);
|
|
return Err(io::Error::new(io::ErrorKind::Other, "Alsa error: PCM open failed"));
|
|
return Err(io::Error::new(io::ErrorKind::Other, "Alsa error: PCM open failed"));
|
|
}
|
|
}
|