summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_openal.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-09 18:06:26 +0200
committerwm4 <wm4@nowhere>2013-05-12 21:24:57 +0200
commitecc6e379b24dd5e37b864ae599a154880a2bd2d0 (patch)
treef439d10380a5f234b660cabb236470cabb1d4d0d /audio/out/ao_openal.c
parentab8f28a672fbd8d21a98c265976068e80be082a7 (diff)
downloadmpv-ecc6e379b24dd5e37b864ae599a154880a2bd2d0.tar.bz2
mpv-ecc6e379b24dd5e37b864ae599a154880a2bd2d0.tar.xz
audio/out: channel map selection
Make all AOs use what has been introduced in the previous commit. Note that even AOs which can handle all possible layouts (like ao_null) use the new functions. This might be important if in the future ao_select_champ() possibly honors global user options about downmixing and so on.
Diffstat (limited to 'audio/out/ao_openal.c')
-rw-r--r--audio/out/ao_openal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c
index 4c906802e1..08f8bc1978 100644
--- a/audio/out/ao_openal.c
+++ b/audio/out/ao_openal.c
@@ -53,7 +53,7 @@ static const ao_info_t info =
LIBAO_EXTERN(openal)
-#define MAX_CHANS 8
+#define MAX_CHANS MP_NUM_CHANNELS
#define NUM_BUF 128
#define CHUNK_SIZE 512
static ALuint buffers[MAX_CHANS][NUM_BUF];
@@ -151,11 +151,11 @@ static int init(int rate, const struct mp_chmap *channels, int format,
list_devices();
goto err_out;
}
- if (ao_data.channels.num > MAX_CHANS) {
- mp_msg(MSGT_AO, MSGL_FATAL, "[OpenAL] Invalid number of channels: %i\n",
- ao_data.channels.num);
+ struct mp_chmap_sel sel = {0};
+ for (i = 0; speaker_pos[i].id != -1; i++)
+ mp_chmap_sel_add_speaker(&sel, speaker_pos[i].id);
+ if (!ao_chmap_sel_adjust(&ao_data, &sel, &ao_data.channels))
goto err_out;
- }
struct speaker speakers[MAX_CHANS];
for (i = 0; i < ao_data.channels.num; i++) {
speakers[i].id = -1;