# HG changeset patch # User diego # Date 1190579853 0 # Node ID 6704a924d4aa40f08161cfac1cc6ccd8ad75b2cf # Parent 150adb2fd0ec857182b533e50130ce0b72ab41d1 According to MSDN a thread must call CoUninitialize once for each successful call it has made to CoInitialize or CoInitializeEx, including any call that returns S_FALSE. Only the CoUninitialize call corresponding to the CoInitialize or CoInitializeEx call that initialized the library can close it. patch by Gianluigi Tiesi, mplayer netfarm it diff -r 150adb2fd0ec -r 6704a924d4aa TOOLS/vfw2menc.c --- a/TOOLS/vfw2menc.c Sun Sep 23 20:23:29 2007 +0000 +++ b/TOOLS/vfw2menc.c Sun Sep 23 20:37:33 2007 +0000 @@ -298,6 +298,6 @@ if (fourcc) free(fourcc); if (filename) free(filename); if (hDriver) CloseDriver(hDriver, 0, 0); - if (coinit == S_OK) CoUninitialize(); + if ((coinit == S_OK) || coinit == S_FALSE) CoUninitialize(); return ret; }