# HG changeset patch # User alex # Date 1017667534 0 # Node ID c13dba5b224edd023fc4e6954078ed1f4e1d44d6 # Parent e12159513d45d922814139267ab7a54a6bc1642b added vfw and acm uninit diff -r e12159513d45 -r c13dba5b224e dll_init.c --- a/dll_init.c Mon Apr 01 13:14:54 2002 +0000 +++ b/dll_init.c Mon Apr 01 13:25:34 2002 +0000 @@ -177,6 +177,32 @@ return len; } +int close_acm_audio_codec(sh_audio_t *sh_audio) +{ + HRESULT ret; + + ret = acmStreamClose(sh_audio->srcstream, 0); + + if (ret) + switch(ret) + { + case ACMERR_BUSY: + case ACMERR_CANCELED: + mp_msg(MSGT_WIN32, MSGL_DBG2, "ACM_Decoder: stream busy, waiting..\n"); + sleep(100); + return(close_acm_audio_codec(sh_audio)); + case ACMERR_UNPREPARED: + case ACMERR_NOTPOSSIBLE: + return(0); + default: + mp_msg(MSGT_WIN32, MSGL_WARN, "ACM_Decoder: unknown error occured: %d\n", ret); + return(0); + } + +// MSACM_UnregisterAllDrivers(); + return(1); +} + int init_vfw_video_codec(sh_video_t *sh_video,int ex){ HRESULT ret; int yuv=0; @@ -412,6 +438,27 @@ return (int)ret; } +int vfw_close_video_codec(sh_video_t *sh_video, int ex) +{ + HRESULT ret; + + ret = ICDecompressEnd(sh_video->hic); + if (ret) + { + mp_msg(MSGT_WIN32, MSGL_WARN, "ICDecompressEnd failed: %d\n", ret); + return(0); + } + + ret = ICClose(sh_video->hic); + if (ret) + { + mp_msg(MSGT_WIN32, MSGL_WARN, "ICClose failed: %d\n", ret); + return(0); + } + + return(1); +} + /************************ VFW COMPRESSION *****************************/ static int encoder_hic=0;