streamio/streamio-ffmpeg — pull request #17 by akicho8 (2011-12-05 16:04:29+00:00)
Title: Fix too many open files error

popen3 stdin not close

### Reproduce code

#!/usr/local/bin/ruby -Ku
require "rubygems"
require "streamio-ffmpeg"
`convert logo: sample.jpg`
200.times{|i|@i=i;FFMPEG::Movie.new("sample.jpg")} rescue (p [@i, $!]) #=> [81, #]
p RUBY_VERSION #=> "1.8.7"
p FFMPEG::VERSION #=> "0.8.4"

### before fix

~/src/streamio-ffmpeg $ rake spec
/opt/local/bin/ruby -S rspec spec/ffmpeg/encoding_options_spec.rb spec/ffmpeg/movie_spec.rb spec/ffmpeg/transcoder_spec.rb spec/streamio-ffmpeg_spec.rb
................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF*FFFFFFFFFF.....
Finished in 2.9 seconds
85 examples, 47 failures, 1 pending

### after fix

~/src/streamio-ffmpeg $ rake spec
/opt/local/bin/ruby -S rspec spec/ffmpeg/encoding_options_spec.rb spec/ffmpeg/movie_spec.rb spec/ffmpeg/transcoder_spec.rb spec/streamio-ffmpeg_spec.rb
.....................................................................*...............
Finished in 21.74 seconds
85 examples, 0 failures, 1 pending