[xiph-cvs] cvs commit: vorbis/vorbis-tools/libao ao_alsa.c ao_oss.c audio_out.c audio_out.h

Kenneth C. Arnold kcarnold at xiph.org
Tue Sep 5 14:38:49 PDT 2000



kcarnold    00/09/05 14:38:48

  Modified:    vorbis-tools/libao Tag: branch_postbeta2 ao_alsa.c ao_oss.c
                        audio_out.c audio_out.h
  Log:
  Removed vorbis-tools/README as it is no longer pertinent.

Revision  Changes    Path
No                   revision

No                   revision

1.4.2.1   +2 -1      vorbis/vorbis-tools/libao/ao_alsa.c

Index: ao_alsa.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vorbis-tools/libao/ao_alsa.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- ao_alsa.c	2000/08/22 13:47:55	1.4
+++ ao_alsa.c	2000/09/05 21:38:48	1.4.2.1
@@ -91,7 +91,8 @@
         {
         case 8  : param.format.format = SND_PCM_SFMT_S8;
                   break;
-	case 16 : param.format.format = SND_PCM_SFMT_S16_LE;
+        case 16 : param.format.format = ao_is_big_endian() ?
+		    SND_PCM_SFMT_S16_BE : SND_PCM_SFMT_S16_LE;
                   break;
         default : return NULL;
         }

1.1.4.2   +2 -2      vorbis/vorbis-tools/libao/ao_oss.c

Index: ao_oss.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vorbis-tools/libao/ao_oss.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -r1.1.4.1 -r1.1.4.2
--- ao_oss.c	2000/08/31 08:05:48	1.1.4.1
+++ ao_oss.c	2000/09/05 21:38:48	1.1.4.2
@@ -120,8 +120,8 @@
         {
         case 8: tmp = AFMT_S8;
                 break;
-	case 16: tmp = AFMT_S16_LE;
-		break;
+        case 16: tmp = ao_is_big_endian() ? AFMT_S16_BE : AFMT_S16_LE;
+	        break;
         default:fprintf(stderr,"libao - Unsupported number of bits: %d.",
                         bits);
                 goto ERR;

1.4.2.1   +11 -0     vorbis/vorbis-tools/libao/audio_out.c

Index: audio_out.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vorbis-tools/libao/audio_out.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- audio_out.c	2000/08/22 13:47:55	1.4
+++ audio_out.c	2000/09/05 21:38:48	1.4.2.1
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <assert.h>
 #include "audio_out.h"
 
 /* --- Function Tables --- */
@@ -267,4 +268,14 @@
                 free(options);
                 options = rest;
         }
+}
+
+/* Helper function lifted from lib/vorbisfile.c */
+int ao_is_big_endian() {
+	uint_16 pattern = 0xbabe;
+	unsigned char *bytewise = (unsigned char *)&pattern;
+	if (bytewise[0] == 0xba) return 1;
+	
+	assert(bytewise[0] == 0xbe);
+	return 0;
 }

1.1.4.1   +2 -0      vorbis/vorbis-tools/libao/audio_out.h

Index: audio_out.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vorbis-tools/libao/audio_out.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -r1.1 -r1.1.4.1
--- audio_out.h	2000/07/22 01:57:05	1.1
+++ audio_out.h	2000/09/05 21:38:48	1.1.4.1
@@ -105,3 +105,5 @@
 int ao_append_option (ao_option_t **options, const char* op_str);
 
 void ao_free_options (ao_option_t* options);
+
+int ao_is_big_endian();

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list