[MPlayer-cvslog] CVS: main/libmpcodecs ad_dvdpcm.c, 1.8, 1.9 ad_hwac3.c, 1.11, 1.12 ad_internal.h, 1.1, 1.2 ad_pcm.c, 1.15, 1.16 ad_ra1428.c, 1.2, 1.3 ad_sample.c, 1.3, 1.4 dec_audio.c, 1.33, 1.34

Alex Beregszaszi syncmail at mplayerhq.hu
Mon Dec 27 18:30:17 CET 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv24154/libmpcodecs

Modified Files:
	ad_dvdpcm.c ad_hwac3.c ad_internal.h ad_pcm.c ad_ra1428.c 
	ad_sample.c dec_audio.c 
Log Message:
removing AFMT_ dependancy

Index: ad_dvdpcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_dvdpcm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ad_dvdpcm.c	19 Nov 2004 14:42:17 -0000	1.8
+++ ad_dvdpcm.c	27 Dec 2004 17:30:14 -0000	1.9
@@ -6,7 +6,6 @@
 #include "mp_msg.h"
 #include "help_mp.h"
 #include "ad_internal.h"
-#include "../libaf/af_format.h"
 
 static ad_info_t info = 
 {
@@ -35,26 +34,25 @@
 	}
 	switch ((h >> 6) & 3) {
 	  case 0:
-	    sh->sample_format = AFMT_S16_BE;
+	    sh->sample_format = AF_FORMAT_S16_BE;
 	    sh->samplesize = 2;
 	    break;
 	  case 1:
 	    mp_msg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_SamplesWanted);
 	    sh->i_bps = sh->channels * sh->samplerate * 5 / 2;
 	  case 2: 
-	    sh->sample_format = AFMT_AF_FLAGS | AF_FORMAT_I |
-	                         AF_FORMAT_BE | AF_FORMAT_SI;
+	    sh->sample_format = AF_FORMAT_S24_BE;
 	    sh->samplesize = 3;
 	    break;
 	  default:
-	    sh->sample_format = AFMT_S16_BE;
+	    sh->sample_format = AF_FORMAT_S16_BE;
 	    sh->samplesize = 2;
 	}
     } else {
 	// use defaults:
 	sh->channels=2;
 	sh->samplerate=48000;
-	sh->sample_format = AFMT_S16_BE;
+	sh->sample_format = AF_FORMAT_S16_BE;
 	sh->samplesize = 2;
     }
     if (!sh->i_bps)

Index: ad_hwac3.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_hwac3.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ad_hwac3.c	19 Dec 2004 16:53:26 -0000	1.11
+++ ad_hwac3.c	27 Dec 2004 17:30:14 -0000	1.12
@@ -105,7 +105,7 @@
   sh->audio_in_minsize = 8192;
   sh->channels = 2;
   sh->samplesize = 2;
-  sh->sample_format = AFMT_AC3;
+  sh->sample_format = AF_FORMAT_AC3;
   return 1;
 }
 

Index: ad_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_internal.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ad_internal.h	25 Mar 2002 21:06:01 -0000	1.1
+++ ad_internal.h	27 Dec 2004 17:30:14 -0000	1.2
@@ -1,6 +1,6 @@
 
 #include "codec-cfg.h"
-#include "../libao2/afmt.h"
+#include "../libaf/af_format.h"
 
 #include "stream.h"
 #include "demuxer.h"

Index: ad_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_pcm.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ad_pcm.c	27 Nov 2004 15:39:38 -0000	1.15
+++ ad_pcm.c	27 Dec 2004 17:30:14 -0000	1.16
@@ -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;
 }

Index: ad_ra1428.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_ra1428.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ad_ra1428.c	1 May 2004 18:36:50 -0000	1.2
+++ ad_ra1428.c	27 Dec 2004 17:30:14 -0000	1.3
@@ -25,7 +25,7 @@
   sh->samplerate=sh->wf->nSamplesPerSec;
   sh->samplesize=sh->wf->wBitsPerSample/8;
   sh->channels=sh->wf->nChannels;
-  sh->sample_format=AFMT_S16_LE;
+  sh->sample_format=AF_FORMAT_S16_LE;
 
 	switch (sh->format) {
 		case mmioFOURCC('1','4','_','4'):

Index: ad_sample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_sample.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ad_sample.c	30 Aug 2002 21:44:20 -0000	1.3
+++ ad_sample.c	27 Dec 2004 17:30:14 -0000	1.4
@@ -47,7 +47,7 @@
   sh->samplesize=2;              // bytes (not bits!) per sample per channel
   sh->channels=2;                // number of channels
   sh->samplerate=44100;          // samplerate
-  sh->sample_format=AFMT_S16_LE; // sample format, see libao2/afmt.h
+  sh->sample_format=AF_FORMAT_S16_LE; // sample format, see libao2/afmt.h
   
   sh->i_bps=64000/8; // input data rate (compressed bytes per second)
   // Note: if you have VBR or unknown input rate, set it to some common or

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- dec_audio.c	15 Nov 2004 15:05:12 -0000	1.33
+++ dec_audio.c	27 Dec 2004 17:30:14 -0000	1.34
@@ -14,7 +14,7 @@
 
 #include "dec_audio.h"
 #include "ad.h"
-#include "../libao2/afmt.h"
+#include "../libaf/af_format.h"
 
 #include "../libaf/af.h"
 
@@ -267,13 +267,15 @@
   // input format: same as codec's output format:
   afs->input.rate   = in_samplerate;
   afs->input.nch    = in_channels;
-  afs->input.format = af_format_decode(in_format);
+//  afs->input.format = af_format_decode(in_format);
+  afs->input.format = in_format;
   afs->input.bps    = in_bps;
 
   // output format: same as ao driver's input format (if missing, fallback to input)
   afs->output.rate   = *out_samplerate ? *out_samplerate : afs->input.rate;
   afs->output.nch    = *out_channels ? *out_channels : afs->input.nch;
-  afs->output.format = *out_format ? af_format_decode(*out_format) : afs->input.format;
+//  afs->output.format = *out_format ? af_format_decode(*out_format) : afs->input.format;
+  afs->output.format = *out_format ? *out_format : afs->input.format;
   afs->output.bps    = out_bps ? out_bps : afs->input.bps;
 
   // filter config:  
@@ -291,11 +293,12 @@
   
   *out_samplerate=afs->output.rate;
   *out_channels=afs->output.nch;
-  *out_format=af_format_encode((void*)(&afs->output));
+//  *out_format=af_format_encode((void*)(&afs->output));
+  *out_format=afs->output.format;
   
   mp_msg(MSGT_DECAUDIO, MSGL_INFO, "AF_pre: af format: %d bps, %d ch, %d hz, %s\n",
       afs->output.bps, afs->output.nch, afs->output.rate,
-      fmt2str(afs->output.format,strbuf,200));
+      af_fmt2str(afs->output.format,strbuf,200));
   
   sh_audio->afilter=(void*)afs;
   return 1;
@@ -315,13 +318,15 @@
   // input format: same as codec's output format:
   afs->input.rate   = in_samplerate;
   afs->input.nch    = in_channels;
-  afs->input.format = af_format_decode(in_format);
+//  afs->input.format = af_format_decode(in_format);
+  afs->input.format = in_format;
   afs->input.bps    = in_bps;
 
   // output format: same as ao driver's input format (if missing, fallback to input)
   afs->output.rate   = out_samplerate ? out_samplerate : afs->input.rate;
   afs->output.nch    = out_channels ? out_channels : afs->input.nch;
-  afs->output.format = af_format_decode(out_format ? out_format : afs->input.format);
+//  afs->output.format = af_format_decode(out_format ? out_format : afs->input.format);
+  afs->output.format = out_format ? out_format : afs->input.format;
   afs->output.bps    = out_bps ? out_bps : afs->input.bps;
 
   // filter config:  
@@ -404,7 +409,8 @@
   afd.len=declen;
   afd.rate=sh_audio->samplerate;
   afd.nch=sh_audio->channels;
-  afd.format=af_format_decode(sh_audio->sample_format);
+//  afd.format=af_format_decode(sh_audio->sample_format);
+  afd.format=sh_audio->sample_format;
   afd.bps=sh_audio->samplesize;
   //pafd=&afd;
 //  printf("\nAF: %d --> ",declen);




More information about the MPlayer-cvslog mailing list