diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-09 07:22:59 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-09 07:22:59 +0000 |
commit | bfcd464606817c21ed272e04425b4d728a356975 (patch) | |
tree | c92262966b850b97148d5b9869b845cf53cf3bee /lib/dtas/player/client_handler.rb | |
parent | 39e037231c80032279d476922dcf3b4fa3d52baa (diff) | |
download | dtas-bfcd464606817c21ed272e04425b4d728a356975.tar.gz |
Otherwise we end up constantly pushing tracks to the top of the queue and getting surprising behavior if seek is called repeatedly.
Diffstat (limited to 'lib/dtas/player/client_handler.rb')
-rw-r--r-- | lib/dtas/player/client_handler.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb index 7a63df1..355451d 100644 --- a/lib/dtas/player/client_handler.rb +++ b/lib/dtas/player/client_handler.rb @@ -363,8 +363,13 @@ module DTAS::Player::ClientHandler # :nodoc: rescue ArgumentError return io.emit("ERR bad time format") end - @queue.unshift([ @current.infile, offset ]) - __buf_reset(@current.dst) # trigger EPIPE + if @current.requeued + @queue[0][1] = offset + else + @queue.unshift([ @current.infile, offset ]) + @current.requeued = true + __buf_reset(@current.dst) # trigger EPIPE + end else return io.emit("ERR unseekable") end |