From 0866effef16595da6d4bd29aa42068190b621974 Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Wed, 16 May 2001 22:23:13 +0000 Subject: dump to file git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@815 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/test.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mp3lib') diff --git a/mp3lib/test.c b/mp3lib/test.c index 9325bd872f..67bf098c5e 100644 --- a/mp3lib/test.c +++ b/mp3lib/test.c @@ -1,4 +1,6 @@ +#define DUMP_PCM + // gcc test.c -I.. -L. -lMP3 -o test -O4 #include @@ -33,6 +35,10 @@ int main(int argc,char* argv[]){ int total=0; unsigned int time1; float length; +#ifdef DUMP_PCM + FILE *f=NULL; + f=fopen("test.pcm","wb"); +#endif mp3file=fopen((argc>1)?argv[1]:"test.mp3","rb"); if(!mp3file){ printf("file not found\n"); exit(1); } @@ -46,9 +52,12 @@ int main(int argc,char* argv[]){ MP3_samplerate=MP3_channels=0; time1=GetTimer(); - while((len=MP3_DecodeFrame(buffer,-1))>0){ + while((len=MP3_DecodeFrame(buffer,-1))>0 && total<2000000){ total+=len; // play it +#ifdef DUMP_PCM + fwrite(buffer,len,1,f); +#endif //putchar('.');fflush(stdout); } time1=GetTimer()-time1; -- cgit v1.2.3