]> git.sesse.net Git - ffmpeg/commit
avformat/udp: cancel pending IO on win32 manually
authorMarton Balint <cus@passwd.hu>
Sun, 26 Jan 2020 21:13:50 +0000 (22:13 +0100)
committerMarton Balint <cus@passwd.hu>
Sun, 2 Feb 2020 18:04:42 +0000 (19:04 +0100)
commit53aa76686e7ff4f1f6625502503d7923cec8c10e
tree43fd5c63b3574aa438625828c9145097615a36ca
parentc2b6493bf7ccbd34c2b28c53093fa6902673a8cd
avformat/udp: cancel pending IO on win32 manually

recvfrom() is not a cancellation point in pthreads-win32, see
https://sourceware.org/pthreads-win32/manual/pthread_cancel.html

In order to be able to cancel the reader thread on Win32 properly we first
shutdown the socket then call CancelIoEx to abort pending IO. Subsequent
recvfrom() calls will fail with WSAESHUTDOWN causing the thread to exit.

Fixes ticket #5717.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/udp.c