summaryrefslogtreecommitdiffstats
path: root/mp3lib
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-16 22:23:13 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-16 22:23:13 +0000
commit0866effef16595da6d4bd29aa42068190b621974 (patch)
tree7c60f0aa773c7d9455d9ddaf1fefd6aba680971b /mp3lib
parent845189da4d0d85f920fb63867a9fda6e841e0fba (diff)
downloadmpv-0866effef16595da6d4bd29aa42068190b621974.tar.bz2
mpv-0866effef16595da6d4bd29aa42068190b621974.tar.xz
dump to file
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@815 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp3lib')
-rw-r--r--mp3lib/test.c11
1 files changed, 10 insertions, 1 deletions
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 <stdio.h>
@@ -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;