summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-26 23:06:21 +0200
committerwm4 <wm4@nowhere>2015-06-26 23:06:21 +0200
commitd6737c5fab489964558b1eed934969c4f151912d (patch)
tree3c35d89e60b52b2ba4a787db20f9af527f24b94d /audio/out
parentefb50cabe6a479fad1f440474a1eb1f47e0ce58f (diff)
downloadmpv-d6737c5fab489964558b1eed934969c4f151912d.tar.bz2
mpv-d6737c5fab489964558b1eed934969c4f151912d.tar.xz
audio: replace format name table
Having a big switch() is simpler.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_coreaudio_utils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c
index 7d504bb04b..96382512e8 100644
--- a/audio/out/ao_coreaudio_utils.c
+++ b/audio/out/ao_coreaudio_utils.c
@@ -236,12 +236,11 @@ bool ca_asbd_equals(const AudioStreamBasicDescription *a,
// Return the AF_FORMAT_* (AF_FORMAT_S16 etc.) corresponding to the asbd.
int ca_asbd_to_mp_format(const AudioStreamBasicDescription *asbd)
{
- for (int n = 0; af_fmtstr_table[n].format; n++) {
- int mp_format = af_fmtstr_table[n].format;
+ for (int fmt = 1; fmt < AF_FORMAT_COUNT; fmt++) {
AudioStreamBasicDescription mp_asbd = {0};
- ca_fill_asbd_raw(&mp_asbd, mp_format, 0, asbd->mChannelsPerFrame);
+ ca_fill_asbd_raw(&mp_asbd, fmt, 0, asbd->mChannelsPerFrame);
if (ca_asbd_equals(&mp_asbd, asbd))
- return mp_format;
+ return fmt;
}
return 0;
}