[Mplayer-cvslog] CVS: main mplayer.c,1.30,1.31
GEREOFFY
arpi_esp at users.sourceforge.net
Wed Mar 28 23:45:14 CEST 2001
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv20903
Modified Files:
mplayer.c
Log Message:
finished DirectShow audio code
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** mplayer.c 2001/03/28 12:08:44 1.30
--- mplayer.c 2001/03/28 21:45:12 1.31
***************
*** 1221,1224 ****
--- 1221,1231 ----
MP3_channels=avi_header.wf.nChannels;
MP3_samplerate=avi_header.wf.nSamplesPerSec;
+
+ avi_header.audio_in_minsize=2*avi_header.wf.nBlockAlign;
+ if(avi_header.audio_in_minsize<8192) avi_header.audio_in_minsize=8192;
+ a_in_buffer_size=avi_header.audio_in_minsize;
+ a_in_buffer=malloc(a_in_buffer_size);
+ a_in_buffer_len=0;
+
} else {
printf("Could not load/initialize Win32/DirctShow AUDIO codec (missing .AX file?)\n");
***************
*** 1490,1493 ****
--- 1497,1527 ----
break;
}
+ case 7: // DirectShow
+ { int ret;
+ int len=a_buffer_size-a_buffer_len;
+ int size_in=0;
+ int size_out=0;
+ int srcsize=DS_AudioDecoder_GetSrcSize(len);
+ if(verbose>2)printf("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,a_in_buffer_size,len);
+ if(srcsize>a_in_buffer_size) srcsize=a_in_buffer_size; // !!!!!!
+ if(a_in_buffer_len<srcsize){
+ a_in_buffer_len+=
+ demux_read_data(d_audio,&a_in_buffer[a_in_buffer_len],
+ srcsize-a_in_buffer_len);
+ }
+ DS_AudioDecoder_Convert(a_in_buffer,a_in_buffer_len,
+ &a_buffer[a_buffer_len],len, &size_in,&size_out);
+ if(verbose>2)printf("DShow: audio %d -> %d converted (in_buf_len=%d of %d)\n",size_in,size_out,a_in_buffer_len,a_in_buffer_size);
+ if(size_in>=a_in_buffer_len){
+ a_in_buffer_len=0;
+ } else {
+ a_in_buffer_len-=size_in;
+ memcpy(a_in_buffer,&a_in_buffer[size_in],a_in_buffer_len);
+ }
+ a_buffer_len+=size_out;
+
+ break;
+ }
+
}
}
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list