about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-02 19:53:32 +0000
committerEric Wong <e@80x24.org>2019-11-02 21:06:25 +0000
commit5ad7e8c09e49ce439acd97ca367d650df5c1de46 (patch)
treec1f732970650a1cd5feca0d3c93a7fe6239d32fe
parent3fea3808526dab5875a2e5d23c7c8e7071223d6a (diff)
downloaddtas-5ad7e8c09e49ce439acd97ca367d650df5c1de46.tar.gz
Attempting to play (and fail) every song in the queue or
tracklist is not ideal when a the USB/HDMI cable to the sound
device gets unplugged by accident.

When tee-ing to multiple sinks, we will still gracefully continue
if one goes dead and there are remaining sinks.

Suggested-by: Rene Maurer
Link: https://80x24.org/dtas-all/874l0kb9qm.fsf@loco10.cumparsita.ch/
-rw-r--r--lib/dtas/player.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index 37f2c96..61d29d2 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -282,7 +282,7 @@ class DTAS::Player # :nodoc:
     if deleted[0]
       warn("#{sink.name} died unexpectedly: #{status.inspect}")
       deleted.each { |t| drop_target(t) }
-      __current_drop unless @targets[0]
+      do_pause unless @targets[0]
       return # sink stays dead if it died unexpectedly
     end
 
@@ -451,7 +451,7 @@ class DTAS::Player # :nodoc:
   # pull data from sink_buf into @targets, source feeds into sink_buf
   def sink_iter
     wait_iter = broadcast_iter(@sink_buf, @targets)
-    __current_drop if nil == wait_iter # sink error, stop source
+    do_pause if nil == wait_iter # sink error, stop source
     return wait_iter if @current
 
     # no source left to feed sink_buf, drain the remaining data