浏览代码

Sink.play is not the opposite of Sink.stop in Rodio

Will Stott 6 年之前
父节点
当前提交
49fd48b42a
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      playback/src/audio_backend/rodio.rs

+ 5 - 2
playback/src/audio_backend/rodio.rs

@@ -68,12 +68,15 @@ impl Open for RodioSink {
 
 impl Sink for RodioSink {
     fn start(&mut self) -> io::Result<()> {
-        self.rodio_sink.play();
+        // More similar to an "unpause" than "play". Doesn't undo "stop".
+        // self.rodio_sink.play();
         Ok(())
     }
 
     fn stop(&mut self) -> io::Result<()> {
-        self.rodio_sink.stop();
+        // This will immediately stop playback, but the sink is then unusable.
+        // We just have to let the current buffer play till the end.
+        // self.rodio_sink.stop();
         Ok(())
     }