comparison dll_init.c @ 5449:c13dba5b224e

added vfw and acm uninit
author alex
date Mon, 01 Apr 2002 13:25:34 +0000
parents a4e774e16b22
children b3d1348b251f
comparison
equal deleted inserted replaced
5448:e12159513d45 5449:c13dba5b224e
175 mp_msg(MSGT_WIN32,MSGL_V,"ACM_Decoder: acmStreamUnprepareHeader error %d\n",(int)hr); 175 mp_msg(MSGT_WIN32,MSGL_V,"ACM_Decoder: acmStreamUnprepareHeader error %d\n",(int)hr);
176 } 176 }
177 return len; 177 return len;
178 } 178 }
179 179
180 int close_acm_audio_codec(sh_audio_t *sh_audio)
181 {
182 HRESULT ret;
183
184 ret = acmStreamClose(sh_audio->srcstream, 0);
185
186 if (ret)
187 switch(ret)
188 {
189 case ACMERR_BUSY:
190 case ACMERR_CANCELED:
191 mp_msg(MSGT_WIN32, MSGL_DBG2, "ACM_Decoder: stream busy, waiting..\n");
192 sleep(100);
193 return(close_acm_audio_codec(sh_audio));
194 case ACMERR_UNPREPARED:
195 case ACMERR_NOTPOSSIBLE:
196 return(0);
197 default:
198 mp_msg(MSGT_WIN32, MSGL_WARN, "ACM_Decoder: unknown error occured: %d\n", ret);
199 return(0);
200 }
201
202 // MSACM_UnregisterAllDrivers();
203 return(1);
204 }
205
180 int init_vfw_video_codec(sh_video_t *sh_video,int ex){ 206 int init_vfw_video_codec(sh_video_t *sh_video,int ex){
181 HRESULT ret; 207 HRESULT ret;
182 int yuv=0; 208 int yuv=0;
183 unsigned int outfmt=sh_video->codec->outfmt[sh_video->outfmtidx]; 209 unsigned int outfmt=sh_video->codec->outfmt[sh_video->outfmtidx];
184 char *temp; 210 char *temp;
408 sh_video->bih, start, 434 sh_video->bih, start,
409 &sh_video->o_bih, 435 &sh_video->o_bih,
410 drop_frame ? 0 : sh_video->our_out_buffer); 436 drop_frame ? 0 : sh_video->our_out_buffer);
411 437
412 return (int)ret; 438 return (int)ret;
439 }
440
441 int vfw_close_video_codec(sh_video_t *sh_video, int ex)
442 {
443 HRESULT ret;
444
445 ret = ICDecompressEnd(sh_video->hic);
446 if (ret)
447 {
448 mp_msg(MSGT_WIN32, MSGL_WARN, "ICDecompressEnd failed: %d\n", ret);
449 return(0);
450 }
451
452 ret = ICClose(sh_video->hic);
453 if (ret)
454 {
455 mp_msg(MSGT_WIN32, MSGL_WARN, "ICClose failed: %d\n", ret);
456 return(0);
457 }
458
459 return(1);
413 } 460 }
414 461
415 /************************ VFW COMPRESSION *****************************/ 462 /************************ VFW COMPRESSION *****************************/
416 463
417 static int encoder_hic=0; 464 static int encoder_hic=0;