changeset 292:a9e211c3faa4

Cleanups and audio format determination.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 17 Mar 2002 21:16:33 +0000
parents a48e886d456f
children ee6e1f8bfae9
files decoders/mpglib/common.c decoders/mpglib/mpg123_sdlsound.h decoders/mpglib/mpglib_sdlsound.h
diffstat 3 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/decoders/mpglib/common.c	Sun Mar 17 21:15:07 2002 +0000
+++ b/decoders/mpglib/common.c	Sun Mar 17 21:16:33 2002 +0000
@@ -25,9 +25,9 @@
      {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,} }
 };
 
-long freqs[9] = { 44100, 48000, 32000,
-                  22050, 24000, 16000 ,
-                  11025 , 12000 , 8000 };
+long mpglib_freqs[9] = { 44100, 48000, 32000,
+                         22050, 24000, 16000 ,
+                         11025 , 12000 , 8000 };
 
 int bitindex;
 unsigned char *wordpointer;
@@ -109,7 +109,7 @@
                          (fr->mode_ext<<2)+4 : 32;
 #endif
         fr->framesize  = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000;
-        fr->framesize /= freqs[fr->sampling_frequency];
+        fr->framesize /= mpglib_freqs[fr->sampling_frequency];
         fr->framesize  = ((fr->framesize+fr->padding)<<2)-4;
 #else
         Sound_SetError("MPGLIB: Not supported!");
@@ -122,7 +122,7 @@
                          (fr->mode_ext<<2)+4 : fr->II_sblimit;
 #endif
         fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000;
-        fr->framesize /= freqs[fr->sampling_frequency];
+        fr->framesize /= mpglib_freqs[fr->sampling_frequency];
         fr->framesize += fr->padding - 4;
 #else
         Sound_SetError("MPGLIB: Not supported!");
@@ -142,7 +142,7 @@
           ssize += 2;
 #endif
           fr->framesize  = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000;
-          fr->framesize /= freqs[fr->sampling_frequency]<<(fr->lsf);
+          fr->framesize /= mpglib_freqs[fr->sampling_frequency]<<(fr->lsf);
           fr->framesize = fr->framesize + fr->padding - 4;
         break; 
       default:
@@ -160,7 +160,7 @@
 
 	fprintf(stderr,"MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n", 
 		fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
-		layers[fr->lay],freqs[fr->sampling_frequency],
+		layers[fr->lay],mpglib_freqs[fr->sampling_frequency],
 		modes[fr->mode],fr->mode_ext,fr->framesize+4);
 	fprintf(stderr,"Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n",
 		fr->stereo,fr->copyright?"Yes":"No",
@@ -179,7 +179,7 @@
 		fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
 		layers[fr->lay],
 		tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],
-		freqs[fr->sampling_frequency], modes[fr->mode]);
+		mpglib_freqs[fr->sampling_frequency], modes[fr->mode]);
 }
 
 #endif
--- a/decoders/mpglib/mpg123_sdlsound.h	Sun Mar 17 21:15:07 2002 +0000
+++ b/decoders/mpglib/mpg123_sdlsound.h	Sun Mar 17 21:16:33 2002 +0000
@@ -185,7 +185,7 @@
 extern void synth_ntom_set_step(long,long);
 
 extern unsigned char *conv16to8;
-extern long freqs[9];
+extern long mpglib_freqs[9];
 extern real muls[27][64];
 extern real decwin[512+32];
 extern real *pnts[5];
--- a/decoders/mpglib/mpglib_sdlsound.h	Sun Mar 17 21:15:07 2002 +0000
+++ b/decoders/mpglib/mpglib_sdlsound.h	Sun Mar 17 21:16:33 2002 +0000
@@ -1,10 +1,10 @@
 
 struct buf {
-        unsigned char *pnt;
+	unsigned char *pnt;
 	long size;
 	long pos;
-        struct buf *next;
-        struct buf *prev;
+	struct buf *next;
+	struct buf *prev;
 };
 
 struct framebuf {
@@ -18,15 +18,15 @@
 	struct buf *head,*tail;
 	int bsize;
 	int framesize;
-        int fsizeold;
+	int fsizeold;
 	struct frame fr;
-        unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
+	unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
 	real hybrid_block[2][2][SBLIMIT*SSLIMIT];
 	int hybrid_blc[2];
 	unsigned long header;
 	int bsnum;
 	real synth_buffs[2][2][0x110];
-        int  synth_bo;
+	int  synth_bo;
 };
 
 #ifndef BOOL
@@ -44,7 +44,7 @@
   
 BOOL InitMP3(struct mpstr *mp);
 int decodeMP3(struct mpstr *mp,char *inmemory,int inmemsize,
-     char *outmemory,int outmemsize,int *done);
+              char *outmemory,int outmemsize,int *done);
 void ExitMP3(struct mpstr *mp);
 
 #ifdef __cplusplus