[xiph-commits] r2951 - liboggplay/trunk/plugin/audio

tahn at svn.annodex.net tahn at svn.annodex.net
Sat Jun 16 01:33:25 PDT 2007


Author: tahn
Date: 2007-06-16 01:33:25 -0700 (Sat, 16 Jun 2007)
New Revision: 2951

Modified:
   liboggplay/trunk/plugin/audio/sydney_audio_mac.c
Log:
Fixed endian handling between PowerPC and Intel Macs. Woohoo!


Modified: liboggplay/trunk/plugin/audio/sydney_audio_mac.c
===================================================================
--- liboggplay/trunk/plugin/audio/sydney_audio_mac.c	2007-06-16 08:05:55 UTC (rev 2950)
+++ liboggplay/trunk/plugin/audio/sydney_audio_mac.c	2007-06-16 08:33:25 UTC (rev 2951)
@@ -196,9 +196,9 @@
    * Set up the render callback used to feed audio data into the output unit.
    */
   AURenderCallbackStruct input;
-	input.inputProc       = audio_callback;
-	input.inputProcRefCon = s;
-	if (AudioUnitSetProperty(s->output_unit, kAudioUnitProperty_SetRenderCallback,
+  input.inputProc       = audio_callback;
+  input.inputProcRefCon = s;
+  if (AudioUnitSetProperty(s->output_unit, kAudioUnitProperty_SetRenderCallback,
       kAudioUnitScope_Input, 0, &input, sizeof(input)) != 0) {
     return SA_ERROR_SYSTEM;
   }
@@ -220,15 +220,17 @@
    */
   AudioStreamBasicDescription fmt;
   fmt.mFormatID         = kAudioFormatLinearPCM;
-	fmt.mFormatFlags      = kLinearPCMFormatFlagIsSignedInteger |
+  fmt.mFormatFlags      = kLinearPCMFormatFlagIsSignedInteger |
+#ifdef __BIG_ENDIAN__
                           kLinearPCMFormatFlagIsBigEndian |
+#endif
                           kLinearPCMFormatFlagIsPacked;
   fmt.mSampleRate       = s->rate;
-	fmt.mChannelsPerFrame = s->n_channels;
-	fmt.mBitsPerChannel   = s->bytes_per_ch * 8;
-	fmt.mFramesPerPacket  = 1;  /* uncompressed audio */
+  fmt.mChannelsPerFrame = s->n_channels;
+  fmt.mBitsPerChannel   = s->bytes_per_ch * 8;
+  fmt.mFramesPerPacket  = 1;  /* uncompressed audio */
   fmt.mBytesPerFrame    = fmt.mChannelsPerFrame * fmt.mBitsPerChannel / 8;
-	fmt.mBytesPerPacket   = fmt.mBytesPerFrame * fmt.mFramesPerPacket;
+  fmt.mBytesPerPacket   = fmt.mBytesPerFrame * fmt.mFramesPerPacket;
 
   /*
    * We're feeding data in to the output bus of the audio system, so we set
@@ -237,7 +239,7 @@
    *
    * http://developer.apple.com/technotes/tn2002/tn2091.html
    */
-	if (AudioUnitSetProperty(s->output_unit, kAudioUnitProperty_StreamFormat,
+  if (AudioUnitSetProperty(s->output_unit, kAudioUnitProperty_StreamFormat,
       kAudioUnitScope_Input, 0, &fmt, sizeof(AudioStreamBasicDescription)) != 0) {
     return SA_ERROR_NOT_SUPPORTED;
   }



More information about the commits mailing list