changeset 5449:c13dba5b224e

added vfw and acm uninit
author alex
date Mon, 01 Apr 2002 13:25:34 +0000
parents e12159513d45
children f8daaed4f54f
files dll_init.c
diffstat 1 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;