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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jun 19 19:10:04 CEST 2012

On 19 Jun 2012, at 11:31, Joe Wreschnig <joe.wreschnig at gmail.com> wrote:
> 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).

What is "modern"? Also it is rather unusual to recompile for different Windows versions, couldn't you with about the same effort just use GetProcAddress (more complex code, but in exchange you'd save on all the configure changes and #ifs).

More information about the ffmpeg-devel mailing list