summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_hrtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/filter/af_hrtf.c')
-rw-r--r--audio/filter/af_hrtf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/audio/filter/af_hrtf.c b/audio/filter/af_hrtf.c
index 4f5eedb29d..72e2ec7c66 100644
--- a/audio/filter/af_hrtf.c
+++ b/audio/filter/af_hrtf.c
@@ -31,6 +31,8 @@
#include "af.h"
#include "dsp.h"
+#include "audio/reorder_ch.h"
+
/* HRTF filter coefficients and adjustable parameters */
#include "af_hrtf.h"
@@ -390,6 +392,12 @@ static struct mp_audio* play(struct af_instance *af, struct mp_audio *data)
float common, left, right, diff, left_b, right_b;
const int dblen = s->dlbuflen, hlen = s->hrflen, blen = s->basslen;
+ // This was written against the old mplayer channel order, which was ALSA.
+ // Feel free to fix the otuput code below to output proper order.
+ reorder_channel_nch(data->audio, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
+ AF_CHANNEL_LAYOUT_ALSA_DEFAULT,
+ data->nch, data->len / data->bps, data->bps);
+
if(AF_OK != RESIZE_LOCAL_BUFFER(af, data))
return NULL;