diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-04-02 07:02:43 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-04-02 07:28:53 +0300 |
commit | f9b5f2870cd7ebb8fe70eeb65e22d11bb88d5202 (patch) | |
tree | 3d369fff359296307c05e120b4d2b53ea5974928 /mp3lib/test.c | |
parent | b8e1456c25de18b8ecb8922d870bfe9161900d2a (diff) | |
download | mpv-f9b5f2870cd7ebb8fe70eeb65e22d11bb88d5202.tar.bz2 mpv-f9b5f2870cd7ebb8fe70eeb65e22d11bb88d5202.tar.xz |
mp3lib: drop internal mp3lib tree
Delete mp3lib which has been the default mp3 decoder until now. In
addition to being an unnecessary embedded library it now fails to
compile correctly with the new gcc-4.6, producing noise.
After the deletion the default decoder priority for mp3 will be first
libmpg123 (a newer version of the code that mp3lib was based on) if
available, then ffmp3float which should be available in all normal
compiles. I think that some tweaking may be required as these decoder
alternatives get wider testing, but any problems should be solvable
and there should be no need for mp3lib.
Diffstat (limited to 'mp3lib/test.c')
-rw-r--r-- | mp3lib/test.c | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/mp3lib/test.c b/mp3lib/test.c deleted file mode 100644 index 446d454008..0000000000 --- a/mp3lib/test.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#define DUMP_PCM - -#include <stdio.h> -#include <stdlib.h> - -#include <unistd.h> -#include <sys/time.h> - -#include "config.h" -#include "mp3lib/mp3.h" -#include "cpudetect.h" - -static inline unsigned int GetTimer(void){ - struct timeval tv; - struct timezone tz; -// float s; - gettimeofday(&tv,&tz); -// s=tv.tv_usec;s*=0.000001;s+=tv.tv_sec; - return tv.tv_sec * 1000000 + tv.tv_usec; -} - -static FILE* mp3file=NULL; - -int mplayer_audio_read(char *buf,int size){ - return fread(buf,1,size,mp3file); -} - -#define BUFFLEN 4608 -static unsigned char buffer[BUFFLEN]; - -int main(int argc,char* argv[]){ - int len; - 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); } - - GetCpuCaps(&gCpuCaps); - - // MPEG Audio: -#ifdef CONFIG_FAKE_MONO - MP3_Init(0); -#else - MP3_Init(); -#endif - MP3_samplerate=MP3_channels=0; - - time1=GetTimer(); - 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; - length=(float)total/(float)(MP3_samplerate*MP3_channels*2); - printf("\nDecoding time: %8.6f\n",(float)time1*0.000001f); - printf("Uncompressed size: %d bytes (%8.3f secs)\n",total,length); - printf("CPU usage at normal playback: %5.2f %%\n",time1*0.0001f/length); - - fclose(mp3file); - return 0; -} |