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

Michael Niedermayer michaelni at gmx.at
Mon Jun 25 14:21:21 CEST 2012

On Tue, Jun 19, 2012 at 07:10:04PM +0200, Reimar Döffinger wrote:
> 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).

It seems versions that dont support this are no longer supported
by microsoft. IMHO we shouldnt bother too much with such old windows
versions unless someone wants to / volunteers to do it.

thus, if there are no objections i will apply this patch once a few
minor issues are fixed (ifdef breaking compile to be precisse)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120625/c04aec77/attachment.asc>

More information about the ffmpeg-devel mailing list