summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_alsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r--audio/out/ao_alsa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 366b912b76..3682e76aa3 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -48,6 +48,7 @@
#include "ao.h"
#include "audio_out_internal.h"
#include "audio/format.h"
+#include "audio/reorder_ch.h"
static const ao_info_t info =
{
@@ -790,6 +791,11 @@ static int play(void* data, int len, int flags)
len = len / ao_data.outburst * ao_data.outburst;
num_frames = len / bytes_per_sample;
+ int bps = af_fmt2bits(ao_data.format) / 8;
+ reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
+ AF_CHANNEL_LAYOUT_ALSA_DEFAULT,
+ ao_data.channels, len / bps, bps);
+
//mp_msg(MSGT_AO,MSGL_ERR,"alsa-play: frames=%i, len=%i\n",num_frames,len);
if (!alsa_handler) {