Skip to content

Commit

Permalink
Fix ffmpeg int on win
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlakshya committed Jul 21, 2024
1 parent c71e79a commit 0296237
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/screen-recorder/childprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ def kill

def send_signal(sig)
ScreenRecorder.logger.debug("Sending #{sig} to process: #{@pid}")
if OS.linux? || OS.mac?
Process.kill sig, -@pid # negative pid == process group
else
signal = sig == SIGTERM ? '/T' : '/T /F'
output = `taskkill #{signal} /PID #{@pid}`
ScreenRecorder.logger.debug("taskkill: #{output}") unless output.empty?
if OS.windows?
Process.kill sig, @pid # process only
return
end

Process.kill sig, -@pid # negative pid == process group
end

def waitpid2(pid, flags = 0)
Expand All @@ -142,4 +141,4 @@ def waitpid2(pid, flags = 0)
true # already dead
end
end # ChildProcess
end # Common
end # Common

0 comments on commit 0296237

Please sign in to comment.