summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r--audio/out/ao_coreaudio.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index e8b0179d20..9407d5f562 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -303,23 +303,16 @@ static int init(struct ao *ao)
&layouts, &n_layouts);
CHECK_CA_ERROR("could not get audio device prefered layouts");
- uint32_t *bitmaps;
- size_t n_bitmaps;
-
- ca_bitmaps_from_layouts(ao, layouts, n_layouts, &bitmaps, &n_bitmaps);
- talloc_free(layouts);
-
struct mp_chmap_sel chmap_sel = {0};
-
- for (int i=0; i < n_bitmaps; i++) {
+ for (int i = 0; i < n_layouts; i++) {
struct mp_chmap chmap = {0};
- mp_chmap_from_lavc(&chmap, bitmaps[i]);
- mp_chmap_sel_add_map(&chmap_sel, &chmap);
+ if (ca_layout_to_mp_chmap(ao, &layouts[i], &chmap))
+ mp_chmap_sel_add_map(&chmap_sel, &chmap);
}
- talloc_free(bitmaps);
+ talloc_free(layouts);
- if (ao->channels.num < 3 || n_bitmaps < 1)
+ if (ao->channels.num < 3)
// If the input is not surround or we could not get any usable
// bitmap from the hardware, default to waveext...
mp_chmap_sel_add_waveext(&chmap_sel);