about summary refs log tree commit homepage
path: root/lib/dtas/player.rb
diff options
authorEric Wong <normalperson@yhbt.net>2013-08-25 22:40:08 +0000
committerEric Wong <normalperson@yhbt.net>2013-08-25 23:13:56 +0000
commit6ad75d32c2389d3bfb358c60b77715db71c1f413 (patch)
tree34ff8b62e2095e95e12717fb6816d33d648db8e5 /lib/dtas/player.rb
parentdfbefc7cb72b2c60e2cb076b33a5964e1be21f33 (diff)
We do not need a respawn flag, since we already infer expected vs
unexpected sink death by checking the @targets array.

Additionally, next_source must always check @current before
calling, and not clobber the existing @current because that
would cause two source processes writing into the same pipe.
Diffstat (limited to 'lib/dtas/player.rb')
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index 99c7400..2a3420a 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -235,17 +235,16 @@ class DTAS::Player # :nodoc:
       warn("#{sink.name} died unexpectedly: #{status.inspect}")
       deleted.each { |t| drop_target(t) }
       __current_drop unless @targets[0]
+      return # sink stays dead if it died unexpectedly
     return unless sink.active
-    if @queue[0] && !@paused
+    if (@current || @queue[0]) && !@paused
       # we get here if source/sinks are all killed in restart_pipeline
-      next_source(@queue.shift)
+      next_source(@queue.shift) unless @current
-  ensure
-    sink.respawn = false
   # returns a wait_ctl arg for self