def call_backend(cmd, waitmsg, mode, params)
pipe = Tempfile.new("boohpipe")
+ Thread.critical = true
pipe.close!
system("mkfifo #{pipe.path}")
+ Thread.critical = false
cmd += " --info-pipe #{pipe.path}"
button, w8 = backend_wait_message($main_window, waitmsg, pipe.path, mode)
pid = nil
$orig_filename = $filename
$main_window.title = 'booh - ' + File.basename($orig_filename)
tmp = Tempfile.new("boohtemp")
+ Thread.critical = true
tmp.close!
#- for security
ios = File.open($filename = tmp.path, File::RDWR|File::CREAT|File::EXCL)
+ Thread.critical = false
ios.close
$tempfiles << $filename << "#{$filename}.backup"
else
#- it's not possible to specify a basename for the output jpeg file with mplayer (file will be named 00000001.jpg); as this can
#- be called from multiple threads, we must come up with a unique directory where to put the file
tmpfile = Tempfile.new("boohvideotmp")
+ Thread.critical = true
tmpfile.close!
begin
Dir.mkdir(tmpdirname = tmpfile.path)
rescue Errno::EEXIST
raise "Tmp directory #{tmpfile.path} already exists"
+ ensure
+ Thread.critical = false
end
cmd = "mplayer '#{orig}' -nosound -vo jpeg:outdir='#{tmpdirname}' -frames 1 -ss #{seektime} >/dev/null 2>/dev/null"
msg 2, cmd