Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
matthutchinson committed Sep 7, 2014
1 parent 516740e commit a9df762
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/lolcommits/capturer/capture_linux.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- encoding : utf-8 -*-
module Lolcommits
class CaptureLinux < Capturer

MPLAYER_FPS = 25

def capture_device_string
Expand Down Expand Up @@ -32,11 +31,11 @@ def capture
debug 'LinuxCapturer: calling out to mplayer to capture image'

# get last frame from tmpdir (regardless of fps)
last_frame = Dir.glob("#{tmpdir}/*.jpg").sort_by { |f|
all_frames = Dir.glob("#{tmpdir}/*.jpg").sort_by do |f|
File.mtime(f)
}.last
end

FileUtils.mv(last_frame, snapshot_location)
FileUtils.mv(all_frames.last, snapshot_location)
debug 'LinuxCapturer: cleaning up'
FileUtils.rm_rf(tmpdir)
end
Expand Down

0 comments on commit a9df762

Please sign in to comment.