Commit d241df94 authored by Felix Paul Kühne's avatar Felix Paul Kühne

audiounit_ios: fix multi-channel audio

parent 91284df6
...@@ -199,9 +199,10 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt) ...@@ -199,9 +199,10 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
AudioStreamBasicDescription streamDescription; AudioStreamBasicDescription streamDescription;
streamDescription.mSampleRate = fmt->i_rate; streamDescription.mSampleRate = fmt->i_rate;
fmt->i_format = VLC_CODEC_FL32; fmt->i_format = VLC_CODEC_FL32;
fmt->i_physical_channels = AOUT_CHANS_STEREO;
streamDescription.mFormatID = kAudioFormatLinearPCM; streamDescription.mFormatID = kAudioFormatLinearPCM;
streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32 streamDescription.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; // FL32
streamDescription.mChannelsPerFrame = 2; streamDescription.mChannelsPerFrame = aout_FormatNbChannels(fmt);
streamDescription.mFramesPerPacket = 1; streamDescription.mFramesPerPacket = 1;
streamDescription.mBitsPerChannel = 32; streamDescription.mBitsPerChannel = 32;
streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8; streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8;
...@@ -323,7 +324,7 @@ static void Play (audio_output_t * p_aout, block_t * p_block) ...@@ -323,7 +324,7 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
} }
/* move data to buffer */ /* 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"); msg_Warn(p_aout, "Audio buffer was dropped");
if (!p_sys->i_bytes_per_sample) if (!p_sys->i_bytes_per_sample)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment