Web lists-archives.com

[MPlayer-dev-eng] [PATCH] Fix hrtf for stereo source




In stereo mode (nch = 2) hrtf filter feeds junk (in[2]..in[4]) into "bass
compensation delay line" (and access past end of buffer while reading last
sample(s), resulting in periodic clicks in some cases).
This looks like regression from svn r15385 ("actually output 2 channel audio
(instead of 6 channel with 4 empty channels)"), before that (dummy) 5-channel
input was forced (or so it looks).
Attached patch should fix this.
Index: MPlayer-20141105/libaf/af_hrtf.c
===================================================================
--- MPlayer-20141105.orig/libaf/af_hrtf.c	2014-11-12 10:24:07.000000000 +0300
+++ MPlayer-20141105/libaf/af_hrtf.c	2014-11-12 10:26:45.000000000 +0300
@@ -278,8 +278,8 @@ static inline void update_ch(af_hrtf_t *
     }
 
     /* We need to update the bass compensation delay line, too. */
-    s->ba_l[k] = in[0] + in[4] + in[2];
-    s->ba_r[k] = in[4] + in[1] + in[3];
+    s->ba_l[k] = s->lf[k] + s->cf[k] + s->lr[k];
+    s->ba_r[k] = s->cf[k] + s->rf[k] + s->rr[k];
 }
 
 /* Initialization and runtime control */
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng