[FFmpeg-devel] [PATCH] Close vfwcap devices on exit()

Ramiro Polla ramiro
Mon Apr 14 18:18:31 CEST 2008


With some devices and some versions of Windows, if you exit() an 
application before you disconnect a VFW driver, that device will
remain unusable until you reboot. This happens in FFmpeg in some cases 
like: ffmpeg -r 15 -f vfwcap -i 0 output.mpg
MPG doesn't accept 15 fps, so FFmpeg just exit()s.

Attached patch fixes this by adding a call to atexit() from within 
read_header that calls a read_close() on all devices that were opened. 
Since atexit() can't take any arguments, I added a static variable with 
all the contexts that are opened (VFW supports only 10 devices).

Ok to apply?

Ramiro Polla
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vfwclose.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080414/2131fe43/attachment.asc>

More information about the ffmpeg-devel mailing list