[vlc-commits] audiounit_ios: fix multi-channel audio

Felix Paul Kühne git at videolan.org
Thu Apr 4 19:36:50 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr  1 16:49:48 2013 +0200| [d241df940a1dc580fea2dcf357f612f8ff35fb0e] | committer: Felix Paul Kühne

audiounit_ios: fix multi-channel audio

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d241df940a1dc580fea2dcf357f612f8ff35fb0e
---

 modules/audio_output/audiounit_ios.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
index 6574ea9..e4d28cc 100644
--- a/modules/audio_output/audiounit_ios.c
+++ b/modules/audio_output/audiounit_ios.c
@@ -199,9 +199,10 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
     AudioStreamBasicDescription streamDescription;
     streamDescription.mSampleRate = fmt->i_rate;
     fmt->i_format = VLC_CODEC_FL32;
+    fmt->i_physical_channels = AOUT_CHANS_STEREO;
     streamDescription.mFormatID = kAudioFormatLinearPCM;
     streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32
-    streamDescription.mChannelsPerFrame = 2;
+    streamDescription.mChannelsPerFrame = aout_FormatNbChannels(fmt);
     streamDescription.mFramesPerPacket = 1;
     streamDescription.mBitsPerChannel = 32;
     streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8;
@@ -323,7 +324,7 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
         }
 
         /* move data to buffer */
-        if (unlikely(TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer)))
+        if (unlikely(!TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer)))
             msg_Warn(p_aout, "Audio buffer was dropped");
 
         if (!p_sys->i_bytes_per_sample)



More information about the vlc-commits mailing list