From 6147bcce359358855ad02d8d5cbd6575d39b0449 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Jun 2015 23:06:37 +0200 Subject: audio: fix format function consistency issues Replace all the check macros with function calls. Give them all the same case and naming schema. Drop af_fmt2bits(). Only af_fmt2bps() survives as af_fmt_to_bytes(). Introduce af_fmt_is_pcm(), and use it in situations that used !AF_FORMAT_IS_SPECIAL. Nobody really knew what a "special" format was. It simply meant "not PCM". --- audio/out/ao_coreaudio_utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'audio/out/ao_coreaudio_utils.c') diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index 96382512e8..77e87b7c23 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -168,22 +168,22 @@ static void ca_fill_asbd_raw(AudioStreamBasicDescription *asbd, int mp_format, { asbd->mSampleRate = samplerate; // Set "AC3" for other spdif formats too - unknown if that works. - asbd->mFormatID = AF_FORMAT_IS_IEC61937(mp_format) ? + asbd->mFormatID = af_fmt_is_spdif(mp_format) ? kAudioFormat60958AC3 : kAudioFormatLinearPCM; asbd->mChannelsPerFrame = num_channels; - asbd->mBitsPerChannel = af_fmt2bits(mp_format); + asbd->mBitsPerChannel = af_fmt_to_bytes(mp_format) * 8; asbd->mFormatFlags = kAudioFormatFlagIsPacked; int channels_per_buffer = num_channels; - if (AF_FORMAT_IS_PLANAR(mp_format)) { + if (af_fmt_is_planar(mp_format)) { asbd->mFormatFlags |= kAudioFormatFlagIsNonInterleaved; channels_per_buffer = 1; } - if (AF_FORMAT_IS_FLOAT(mp_format)) { + if (af_fmt_is_float(mp_format)) { asbd->mFormatFlags |= kAudioFormatFlagIsFloat; - } else if (!af_fmt_unsigned(mp_format)) { + } else if (!af_fmt_is_unsigned(mp_format)) { asbd->mFormatFlags |= kAudioFormatFlagIsSignedInteger; } -- cgit v1.2.3