From 6ad75d32c2389d3bfb358c60b77715db71c1f413 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Aug 2013 22:40:08 +0000 Subject: player: fix logic around sink death/respawns 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. --- lib/dtas/player.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/dtas/player.rb') 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 -- cgit v1.2.3-24-ge0c7