[Mplayer-cvslog] CVS: main/libaf af_format.c,1.14,1.15

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue May 18 21:13:17 CEST 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv7410

Modified Files:
	af_format.c 
Log Message:
using bswap.h for endianness conversion


Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- af_format.c	16 May 2004 16:21:33 -0000	1.14
+++ af_format.c	18 May 2004 19:13:15 -0000	1.15
@@ -11,6 +11,7 @@
 #include <limits.h>
 
 #include "af.h"
+#include "../bswap.h"
 
 // Integer to float conversion through lrintf()
 #ifdef HAVE_LRINTF
@@ -379,10 +380,8 @@
   register int i;
   switch(bps){
     case(2):{
-      register uint16_t s;
       for(i=0;i<len;i++){
-	s=((uint16_t*)in)[i];
-	((uint16_t*)out)[i]=(uint16_t)(((s&0x00FF)<<8) | (s&0xFF00)>>8);
+	((uint16_t*)out)[i]=bswap_16(((uint16_t*)in)[i]);
       }
       break;
     }
@@ -398,13 +397,8 @@
       break;
     }
     case(4):{
-      register uint32_t s;
       for(i=0;i<len;i++){
-	s=((uint32_t*)in)[i];
-	((uint32_t*)out)[i]=(uint32_t)(((s&0x000000FF)<<24) | 
-				       ((s&0x0000FF00)<<8)  |
-				       ((s&0x00FF0000)>>8)  |
-				       ((s&0xFF000000)>>24));
+	((uint32_t*)out)[i]=bswap_32(((uint32_t*)in)[i]);
       }
       break;
     }




More information about the MPlayer-cvslog mailing list