[FFmpeg-devel] [PATCH] Support Ctrl+Break in ffmpeg.exe on Windows as if it was Ctrl+C

Joe Wreschnig joe.wreschnig at gmail.com
Tue Jun 19 11:31:01 CEST 2012

On Windows, the Ctrl+Break key combination usually does what Ctrl+C
does. It is more common for processes to send other processes
Ctrl+Break rather than Ctrl+C, because sending Ctrl+C / SIGINT doesn't
work if you started a child in a new process group.

This patch makes ffmpeg.exe register what Windows calls a console
control event handler, which allows it to intercept Ctrl+Break. It
hands it off directly to the usual SIGINT/SIGTERM handler. The same
function also processes closing the console window, mapping it to

Obviously, this is only enabled if compiling for a platform where
SetConsoleCtrlHandler is available (i.e. modern Windows).

(I've also submitted this as a ticket at
https://ffmpeg.org/trac/ffmpeg/ticket/1463 but it was recommended I
post it here also.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-sigbreak.diff
Type: application/octet-stream
Size: 1727 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120619/34458efc/attachment.obj>

More information about the ffmpeg-devel mailing list