about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dtas/player.rb7
-rw-r--r--lib/dtas/player/client_handler.rb2
-rw-r--r--lib/dtas/sink.rb2
3 files changed, 3 insertions, 8 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
     end
 
     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
       __sink_activate(sink)
-      next_source(@queue.shift)
+      next_source(@queue.shift) unless @current
     end
-  ensure
-    sink.respawn = false
   end
 
   # returns a wait_ctl arg for self
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 44f0b57..e08d9a3 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -91,7 +91,6 @@ module DTAS::Player::ClientHandler # :nodoc:
         # do not reactivate it until we've reaped it
         if sink.pid
           drop_sink(sink)
-          sink.respawn = true
         else
           __sink_activate(sink)
         end
@@ -375,7 +374,6 @@ module DTAS::Player::ClientHandler # :nodoc:
   def restart_pipeline
     return if @paused
     __current_requeue
-    @sinks.each_value { |sink| sink.respawn = sink.active }
     @targets.each { |t| drop_target(t) }.clear
   end
 
diff --git a/lib/dtas/sink.rb b/lib/dtas/sink.rb
index e28d479..836b0f1 100644
--- a/lib/dtas/sink.rb
+++ b/lib/dtas/sink.rb
@@ -16,7 +16,6 @@ class DTAS::Sink # :nodoc:
   attr_accessor :active  # boolean
   attr_accessor :name
   attr_accessor :nonblock
-  attr_accessor :respawn
 
   include DTAS::Command
   include DTAS::Process
@@ -30,7 +29,6 @@ class DTAS::Sink # :nodoc:
     "nonblock" => false,
     "pipe_size" => nil,
     "active" => false,
-    "respawn" => false,
   })
 
   DEVFD_RE = %r{/dev/fd/([a-zA-Z]\w*)\b}