Skip to content

Commit

Permalink
Process up to 100 frames without a break
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Apr 11, 2012
1 parent 442f668 commit 4138def
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/javascripts/player/movie.js.coffee
Expand Up @@ -13,6 +13,7 @@ class AsciiIo.Movie
@playing = false
@lastFrameTime = undefined
@timeElapsedBeforePause = undefined
@framesProcessed = 0

isLoaded: ->
@model.get('escaped_stdout_data') != undefined
Expand Down Expand Up @@ -133,9 +134,11 @@ class AsciiIo.Movie
if frame = @timing()[@frameNo]
[delay, count] = frame

if delay <= @MIN_DELAY
if delay <= @MIN_DELAY and @framesProcessed < 100
@framesProcessed += 1
@processFrame()
else
@framesProcessed = 0
realDelay = delay * 1000 * (1.0 / @options.speed)
@processFrameWithDelay(realDelay)

Expand Down

0 comments on commit 4138def

Please sign in to comment.