summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_utils.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-26 23:06:37 +0200
committerwm4 <wm4@nowhere>2015-06-26 23:06:37 +0200
commit6147bcce359358855ad02d8d5cbd6575d39b0449 (patch)
tree5cb8bafc418cd71b68f95766ad01b3312feed518 /audio/out/ao_coreaudio_utils.c
parentd6737c5fab489964558b1eed934969c4f151912d (diff)
downloadmpv-6147bcce359358855ad02d8d5cbd6575d39b0449.tar.bz2
mpv-6147bcce359358855ad02d8d5cbd6575d39b0449.tar.xz
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".
Diffstat (limited to 'audio/out/ao_coreaudio_utils.c')
-rw-r--r--audio/out/ao_coreaudio_utils.c10
1 files changed, 5 insertions, 5 deletions
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;
}