summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_alsa.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-23 17:23:33 +0100
committerwm4 <wm4@nowhere>2013-04-13 04:21:28 +0200
commitf54909d4df1e1f00481e3ca4aae02f9bf7b78668 (patch)
tree90eb2917f097064388c0814a8982566935151e9e /audio/out/ao_alsa.c
parente4da6718205d9924eb447968f8aa68aee08dcc93 (diff)
downloadmpv-f54909d4df1e1f00481e3ca4aae02f9bf7b78668.tar.bz2
mpv-f54909d4df1e1f00481e3ca4aae02f9bf7b78668.tar.xz
ao_alsa: reorder channels from internal to alsa order
Currently, internal and alsa order are exactly the same, so this will do absolutely nothing.
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) {