0016-audiounit_ios-fix-multi-channel-audio.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From d53127fcec0f13e4a77ae45e433666f10b25c1f6 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
  3. Date: Mon, 1 Apr 2013 16:49:48 +0200
  4. Subject: [PATCH 1/4] audiounit_ios: fix multi-channel audio
  5. ---
  6. modules/audio_output/audiounit_ios.c | 5 +++--
  7. 1 file changed, 3 insertions(+), 2 deletions(-)
  8. diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
  9. index 6574ea9..e4d28cc 100644
  10. --- a/modules/audio_output/audiounit_ios.c
  11. +++ b/modules/audio_output/audiounit_ios.c
  12. @@ -199,9 +199,10 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
  13. AudioStreamBasicDescription streamDescription;
  14. streamDescription.mSampleRate = fmt->i_rate;
  15. fmt->i_format = VLC_CODEC_FL32;
  16. + fmt->i_physical_channels = AOUT_CHANS_STEREO;
  17. streamDescription.mFormatID = kAudioFormatLinearPCM;
  18. streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32
  19. - streamDescription.mChannelsPerFrame = 2;
  20. + streamDescription.mChannelsPerFrame = aout_FormatNbChannels(fmt);
  21. streamDescription.mFramesPerPacket = 1;
  22. streamDescription.mBitsPerChannel = 32;
  23. streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8;
  24. @@ -323,7 +324,7 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
  25. }
  26. /* move data to buffer */
  27. - if (unlikely(TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer)))
  28. + if (unlikely(!TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer)))
  29. msg_Warn(p_aout, "Audio buffer was dropped");
  30. if (!p_sys->i_bytes_per_sample)
  31. --
  32. 1.7.12.4 (Apple Git-37)