diff libmpcodecs/ad_pcm.c @ 14245:815f03b7cee5

removing AFMT_ dependancy
author alex
date Mon, 27 Dec 2004 17:30:15 +0000
parents efe58d68689e
children 78385a72a8bb
line wrap: on
line diff
--- a/libmpcodecs/ad_pcm.c	Mon Dec 27 11:09:49 2004 +0000
+++ b/libmpcodecs/ad_pcm.c	Mon Dec 27 17:30:15 2004 +0000
@@ -24,31 +24,31 @@
   sh_audio->channels=h->nChannels;
   sh_audio->samplerate=h->nSamplesPerSec;
   sh_audio->samplesize=(h->wBitsPerSample+7)/8;
-  sh_audio->sample_format=AFMT_S16_LE; // default
+  sh_audio->sample_format=AF_FORMAT_S16_LE; // default
   switch(sh_audio->format){ /* hardware formats: */
     case 0x0:
     case 0x1: // Microsoft PCM
        switch (sh_audio->samplesize) {
-         case 1: sh_audio->sample_format=AFMT_U8; break;
-         case 2: sh_audio->sample_format=AFMT_S16_LE; break;
-         case 3: sh_audio->sample_format=AFMT_S24_LE; break;
-         case 4: sh_audio->sample_format=AFMT_S32_LE; break;
+         case 1: sh_audio->sample_format=AF_FORMAT_U8; break;
+         case 2: sh_audio->sample_format=AF_FORMAT_S16_LE; break;
+         case 3: sh_audio->sample_format=AF_FORMAT_S24_LE; break;
+         case 4: sh_audio->sample_format=AF_FORMAT_S32_LE; break;
        }
        break;
-    case 0x6:  sh_audio->sample_format=AFMT_A_LAW;break;
-    case 0x7:  sh_audio->sample_format=AFMT_MU_LAW;break;
-    case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break;
-    case 0x50: sh_audio->sample_format=AFMT_MPEG;break;
+    case 0x6:  sh_audio->sample_format=AF_FORMAT_A_LAW;break;
+    case 0x7:  sh_audio->sample_format=AF_FORMAT_MU_LAW;break;
+    case 0x11: sh_audio->sample_format=AF_FORMAT_IMA_ADPCM;break;
+    case 0x50: sh_audio->sample_format=AF_FORMAT_MPEG2;break;
 /*    case 0x2000: sh_audio->sample_format=AFMT_AC3; */
     case 0x20776172: // 'raw '
-       sh_audio->sample_format=AFMT_S16_BE;
-       if(sh_audio->samplesize==1) sh_audio->sample_format=AFMT_U8;
+       sh_audio->sample_format=AF_FORMAT_S16_BE;
+       if(sh_audio->samplesize==1) sh_audio->sample_format=AF_FORMAT_U8;
        break;
     case 0x736F7774: // 'twos'
-       sh_audio->sample_format=AFMT_S16_BE;
+       sh_audio->sample_format=AF_FORMAT_S16_BE;
        // intended fall-through
     case 0x74776F73: // 'swot'
-       if(sh_audio->samplesize==1) sh_audio->sample_format=AFMT_S8;
+       if(sh_audio->samplesize==1) sh_audio->sample_format=AF_FORMAT_S8;
 // Uncomment this if twos audio is broken for you
 // (typically with movies made on sgi machines)
 // This is just a workaround, the real bug is elsewhere
@@ -58,10 +58,10 @@
 #endif
        break;
     case 0x32336c66: // 'fl32', bigendian float32
-       sh_audio->sample_format=AFMT_AF_FLAGS | AF_FORMAT_BE | AF_FORMAT_F;
+       sh_audio->sample_format=AF_FORMAT_FLOAT_BE;
        sh_audio->samplesize=4;
        break;
-    default: if(sh_audio->samplesize!=2) sh_audio->sample_format=AFMT_U8;
+    default: if(sh_audio->samplesize!=2) sh_audio->sample_format=AF_FORMAT_U8;
   }
   return 1;
 }