[gaim-migrate @ 4876]

Thu, 20 Feb 2003 05:00:27 +0000

author
Nathan Conrad
date
Thu, 20 Feb 2003 05:00:27 +0000
changeset 4592
2781fc0f3d32
parent 4591
8e8206e42604
child 4593
857a5ea2830a

[gaim-migrate @ 4876]
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.

committer: Nathan Walp <nwalp@pidgin.im>

src/gaimrc.c file | annotate | diff | comparison | revisions
src/sound.c file | annotate | diff | comparison | revisions
--- a/src/gaimrc.c	Thu Feb 20 01:36:50 2003 +0000
+++ b/src/gaimrc.c	Thu Feb 20 05:00:27 2003 +0000
@@ -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 &&
--- a/src/sound.c	Thu Feb 20 01:36:50 2003 +0000
+++ b/src/sound.c	Thu Feb 20 05:00:27 2003 +0000
@@ -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;
 

mercurial