1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

dump to file

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@815 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi_esp 2001-05-16 22:23:13 +00:00
parent 845189da4d
commit 0866effef1

View File

@ -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;