From ea215a11ab5ff5ad41c505d3b1565a49774b91f7 Mon Sep 17 00:00:00 2001 From: Sean Bartell Date: Sun, 21 Aug 2011 17:18:30 -0400 Subject: [PATCH 2/6] rbcodec refactoring: make DSP yield each iteration --- lib/rbcodec/dsp/dsp.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/lib/rbcodec/dsp/dsp.c b/lib/rbcodec/dsp/dsp.c index dc64648..c76bfe9 100644 --- a/lib/rbcodec/dsp/dsp.c +++ b/lib/rbcodec/dsp/dsp.c @@ -1198,8 +1198,6 @@ int dsp_callback(int msg, intptr_t param) int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count) { int32_t *tmp[2]; - static long last_yield; - long tick; int written = 0; #if defined(CPU_COLDFIRE) @@ -1213,7 +1211,6 @@ int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count) dsp_set_replaygain(); /* Gain has changed */ /* Perform at least one yield before starting */ - last_yield = current_tick; yield(); /* Testing function pointers for NULL is preferred since the pointer @@ -1270,13 +1267,7 @@ int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count) written += chunk; dst += chunk * sizeof (int16_t) * 2; - /* yield at least once each tick */ - tick = current_tick; - if (TIME_AFTER(tick, last_yield)) - { - last_yield = tick; - yield(); - } + yield(); } } -- 1.7.6