From 80ec0ba6d05df65df42c3a7f74c5e2987cb682d7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 2 Jul 2014 08:02:00 +0200 Subject: ao_coreaudio: fill asbd with an helper function --- audio/out/ao_coreaudio.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'audio/out/ao_coreaudio.c') diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 615bb41fa0..7f3b70c15a 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -127,26 +127,7 @@ static int init(struct ao *ao) // Build ASBD for the input format AudioStreamBasicDescription asbd; - asbd.mSampleRate = ao->samplerate; - asbd.mFormatID = kAudioFormatLinearPCM; - asbd.mChannelsPerFrame = ao->channels.num; - asbd.mBitsPerChannel = af_fmt2bits(ao->format); - asbd.mFormatFlags = kAudioFormatFlagIsPacked; - - if ((ao->format & AF_FORMAT_POINT_MASK) == AF_FORMAT_F) - asbd.mFormatFlags |= kAudioFormatFlagIsFloat; - - if ((ao->format & AF_FORMAT_SIGN_MASK) == AF_FORMAT_SI) - asbd.mFormatFlags |= kAudioFormatFlagIsSignedInteger; - - if ((ao->format & AF_FORMAT_END_MASK) == AF_FORMAT_BE) - asbd.mFormatFlags |= kAudioFormatFlagIsBigEndian; - - asbd.mFramesPerPacket = 1; - asbd.mBytesPerPacket = asbd.mBytesPerFrame = - asbd.mFramesPerPacket * asbd.mChannelsPerFrame * - (asbd.mBitsPerChannel / 8); - + ca_fill_asbd(ao, &asbd); return init_lpcm(ao, asbd); coreaudio_error: -- cgit v1.2.3