Staging: oslec bug fix
authorDavid Rowe <david@rowetel.com>
Wed, 20 May 2009 01:48:27 +0000 (11:18 +0930)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:54 +0000 (11:00 -0700)
I have just had a bug fix submitted for Oslec which I have applied to
Oslec SVN. The bug can potentially stops the echo canceller adapting
after a few seconds, although it hasn't caused many problems in
practice.

Signed-off-by: David Rowe <david@rowetel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/echo/echo.c

index 6d7217e1bd06e72a8cb721f4eca0c395d70311d6..79d15c65bfe458a1f236a5960fdbba7ebcfce352 100644 (file)
@@ -395,7 +395,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
                old = (int)ec->fir_state.history[ec->fir_state.curr_pos] *
                    (int)ec->fir_state.history[ec->fir_state.curr_pos];
                ec->Pstates +=
-                   ((new - old) + (1 << ec->log2taps)) >> ec->log2taps;
+                   ((new - old) + (1 << (ec->log2taps-1))) >> ec->log2taps;
                if (ec->Pstates < 0)
                        ec->Pstates = 0;
        }