From: Nathan W. <fac...@us...> - 2003-02-20 05:00:32
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv27481/src Modified Files: gaimrc.c sound.c Log Message: Nathan Conrad pointed out that sounds were in pretty lousy shape on those wacky big-endian monsters. This should take care of that, and not hurt us little-endian guys in the process. Oh, and there was a chance that sound wouldn't get initialized in weird situations. This should fix that. Index: gaimrc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- gaimrc.c 19 Feb 2003 23:27:36 -0000 1.141 +++ gaimrc.c 20 Feb 2003 05:00:26 -0000 1.142 @@ -801,8 +801,10 @@ /* this is where we do bugs and compatibility stuff */ if (!(sound_options & (OPT_SOUND_BEEP | OPT_SOUND_NORMAL | OPT_SOUND_ESD - | OPT_SOUND_ARTS | OPT_SOUND_NAS | OPT_SOUND_CMD))) + | OPT_SOUND_ARTS | OPT_SOUND_NAS | OPT_SOUND_CMD))) { sound_options |= OPT_SOUND_NORMAL; + gaim_sound_change_output_method(); + } if (conv_size.width == 0 && conv_size.height == 0 && Index: sound.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/sound.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- sound.c 14 Feb 2003 20:57:31 -0000 1.79 +++ sound.c 20 Feb 2003 05:00:27 -0000 1.80 @@ -34,6 +34,10 @@ #include <mmsystem.h> #endif +#ifdef HAVE_ENDIAN_H +#include <endian.h> +#endif + #ifdef USE_AO #include <ao/ao.h> #include <audiofile.h> @@ -229,10 +233,15 @@ afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, format.bits); - if(afGetByteOrder(file, AF_DEFAULT_TRACK) == AF_BYTEORDER_BIGENDIAN) - format.byte_format = AO_FMT_BIG; - else - format.byte_format = AO_FMT_LITTLE; +#if __BYTE_ORDER == __BIG_ENDIAN + format.byte_format = AO_FMT_BIG; + afSetVirtualByteOrder(file, AF_DEFAULT_TRACK, + AF_BYTEORDER_BIGENDIAN); +#elif __BYTE_ORDER == __LITTLE_ENDIAN + format.byte_format = AO_FMT_LITTLE; + afSetVirtualByteOrder(file, AF_DEFAULT_TRACK, + AF_BYTEORDER_LITTLEENDIAN); +#endif bytes_per_frame = format.bits * format.channels / 8; |