[Mplayer-cvslog] CVS: main/libao2 afmt.h,1.4,1.5 pl_eq.c,1.6,1.7 pl_extrastereo.c,1.3,1.4 pl_resample.c,1.11,1.12 pl_surround.c,1.12,1.13 pl_volnorm.c,1.5,1.6 pl_volume.c,1.2,1.3

Colin Leroy CVS colin at mplayerhq.hu
Fri Jan 3 16:12:21 CET 2003


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv10116

Modified Files:
	afmt.h pl_eq.c pl_extrastereo.c pl_resample.c pl_surround.c 
	pl_volnorm.c pl_volume.c 
Log Message:
(nicer) endianness fix for every plugin except pl_format


Index: afmt.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/afmt.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- afmt.h	17 Nov 2002 17:35:31 -0000	1.4
+++ afmt.h	3 Jan 2003 15:12:18 -0000	1.5
@@ -9,6 +9,8 @@
 #endif
 #endif
 
+#include "../config.h" /* for native endianness */
+
 /* standard, old OSS audio formats */
 #ifndef AFMT_MU_LAW
 #	define AFMT_MU_LAW		0x00000001

Index: pl_eq.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_eq.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pl_eq.c	6 Nov 2002 23:54:23 -0000	1.6
+++ pl_eq.c	3 Jan 2003 15:12:18 -0000	1.7
@@ -122,7 +122,7 @@
   float F[KM] = CF;
   
   // Check input format
-  if(ao_plugin_data.format != AFMT_S16_LE){
+  if(ao_plugin_data.format != AFMT_S16_NE){
     fprintf(stderr,"[pl_eq] Input audio format not yet supported. \n");
     return 0;
   }

Index: pl_extrastereo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_extrastereo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pl_extrastereo.c	3 Jan 2003 14:49:02 -0000	1.3
+++ pl_extrastereo.c	3 Jan 2003 15:12:18 -0000	1.4
@@ -20,7 +20,6 @@
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
 #include "afmt.h"
-#include "../config.h"
 
 static ao_info_t info = {
         "Extra stereo plugin",
@@ -58,11 +57,7 @@
 // return: 1=success 0=fail
 static int init(){
   switch(ao_plugin_data.format){
-#ifndef WORDS_BIGENDIAN
-  case(AFMT_S16_LE):
-#else
-  case(AFMT_S16_BE):
-#endif
+  case(AFMT_S16_NE):
     break;
   default:
     fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n");
@@ -92,11 +87,7 @@
 static int play(){
 
   switch(pl_extrastereo.format){
-#ifndef WORDS_BIGENDIAN
-  case(AFMT_S16_LE): {
-#else
-  case(AFMT_S16_BE): {
-#endif
+  case(AFMT_S16_NE): {
 
     int16_t* data=(int16_t*)ao_plugin_data.data;
     int len=ao_plugin_data.len / 2; // 16 bits samples

Index: pl_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_resample.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- pl_resample.c	3 Jan 2003 14:51:49 -0000	1.11
+++ pl_resample.c	3 Jan 2003 15:12:18 -0000	1.12
@@ -24,7 +24,6 @@
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
 #include "afmt.h"
-#include "../config.h"
 
 static ao_info_t info =
 {
@@ -120,11 +119,7 @@
   pl_resample.up=UP;
 
   // Sheck input format
-#ifndef WORDS_BIGENDIAN
-  if(ao_plugin_data.format != AFMT_S16_LE){
-#else
-  if(ao_plugin_data.format != AFMT_S16_BE){
-#endif	  
+  if(ao_plugin_data.format != AFMT_S16_NE){
     fprintf(stderr,"[pl_resample] Input audio format not yet suported. \n");
     return 0;
   }

Index: pl_surround.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_surround.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- pl_surround.c	6 Nov 2002 23:54:23 -0000	1.12
+++ pl_surround.c	3 Jan 2003 15:12:18 -0000	1.13
@@ -108,8 +108,8 @@
     pl_surround.passthrough = 1;
     return 1;
   }
-  if (ao_plugin_data.format != AFMT_S16_LE) {
-    fprintf(stderr, "pl_surround: I'm dumb and can only handle AFMT_S16_LE audio format, using passthrough mode\n");
+  if (ao_plugin_data.format != AFMT_S16_NE) {
+    fprintf(stderr, "pl_surround: I'm dumb and can only handle AFMT_S16_NE audio format, using passthrough mode\n");
     pl_surround.passthrough = 1;
     return 1;
   }

Index: pl_volnorm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_volnorm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- pl_volnorm.c	17 Nov 2002 12:03:01 -0000	1.5
+++ pl_volnorm.c	3 Jan 2003 15:12:18 -0000	1.6
@@ -31,7 +31,6 @@
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
 #include "afmt.h"
-#include "../config.h"
 
 static ao_info_t info = {
         "Volume normalizer",
@@ -117,11 +116,7 @@
 // return: 1=success 0=fail
 static int init(){
   switch(ao_plugin_data.format){
-#ifndef WORDS_BIGENDIAN
-    case(AFMT_S16_LE):
-#else
-    case(AFMT_S16_BE):
-#endif
+    case(AFMT_S16_NE):
       break;
     default:
       fprintf(stderr,"[pl_volnorm] Audio format not yet supported.\n");
@@ -147,11 +142,7 @@
   int i;
   mul = MUL_INIT;
   switch(ao_plugin_data.format) {
-#ifndef WORDS_BIGENDIAN
-    case(AFMT_S16_LE):
-#else
-    case(AFMT_S16_BE):
-#endif
+    case(AFMT_S16_NE):
 #if AVG==1
       lastavg = MID_S16;
 #elif AVG==2
@@ -174,11 +165,7 @@
 static int play(){
 
   switch(pl_volnorm.format){
-#ifndef WORDS_BIGENDIAN
-  case(AFMT_S16_LE): {
-#else
-  case(AFMT_S16_BE): {
-#endif
+  case(AFMT_S16_NE): {
 #define CLAMP(x,m,M) do { if ((x)<(m)) (x) = (m); else if ((x)>(M)) (x) = (M); } while(0)
 
     int16_t* data=(int16_t*)ao_plugin_data.data;

Index: pl_volume.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_volume.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pl_volume.c	13 Mar 2002 12:32:42 -0000	1.2
+++ pl_volume.c	3 Jan 2003 15:12:18 -0000	1.3
@@ -81,7 +81,7 @@
   // Sanity sheck this plugin supports AFMT_U8 and AFMT_S16_LE
   switch(ao_plugin_data.format){
   case(AFMT_U8):
-  case(AFMT_S16_LE):
+  case(AFMT_S16_NE):
     break;
   default: 
     fprintf(stderr,"[pl_volume] Audio format not yet suported \n");
@@ -135,7 +135,7 @@
       }
       break;
   }
-  case(AFMT_S16_LE):{
+  case(AFMT_S16_NE):{
     register int len=ao_plugin_data.len>>1;
     register int16_t* data=(int16_t*)ao_plugin_data.data;
     register int x;



More information about the MPlayer-cvslog mailing list