[Mplayer-cvslog] CVS: main dll_init.c,1.40,1.41

Alex Beregszaszi alex at mplayer.dev.hu
Mon Apr 1 15:25:37 CEST 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv30419

Modified Files:
	dll_init.c 
Log Message:
added vfw and acm uninit

Index: dll_init.c
===================================================================
RCS file: /cvsroot/mplayer/main/dll_init.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- dll_init.c	10 Feb 2002 12:20:50 -0000	1.40
+++ dll_init.c	1 Apr 2002 13:25:34 -0000	1.41
@@ -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;
@@ -410,6 +436,27 @@
                         drop_frame ? 0 : sh_video->our_out_buffer);
 
     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 *****************************/




More information about the MPlayer-cvslog mailing list