changeset 8218:48deec5d2050

volnorm for bigendian
author colin
date Sun, 17 Nov 2002 12:03:01 +0000
parents e741609ec32a
children 8f6548a70cda
files libao2/pl_volnorm.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/pl_volnorm.c	Sun Nov 17 00:00:27 2002 +0000
+++ b/libao2/pl_volnorm.c	Sun Nov 17 12:03:01 2002 +0000
@@ -31,6 +31,7 @@
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
 #include "afmt.h"
+#include "../config.h"
 
 static ao_info_t info = {
         "Volume normalizer",
@@ -116,7 +117,11 @@
 // 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
       break;
     default:
       fprintf(stderr,"[pl_volnorm] Audio format not yet supported.\n");
@@ -142,7 +147,11 @@
   int i;
   mul = MUL_INIT;
   switch(ao_plugin_data.format) {
+#ifndef WORDS_BIGENDIAN
     case(AFMT_S16_LE):
+#else
+    case(AFMT_S16_BE):
+#endif
 #if AVG==1
       lastavg = MID_S16;
 #elif AVG==2
@@ -165,8 +174,11 @@
 static int play(){
 
   switch(pl_volnorm.format){
+#ifndef WORDS_BIGENDIAN
   case(AFMT_S16_LE): {
-
+#else
+  case(AFMT_S16_BE): {
+#endif
 #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;