summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/dsp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index 5bbbe08ac2..a259ea4aae 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -1112,7 +1112,8 @@ int dsp_callback(int msg, intptr_t param)
1112int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count) 1112int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count)
1113{ 1113{
1114 int32_t *tmp[2]; 1114 int32_t *tmp[2];
1115 long last_yield = current_tick; 1115 static long last_yield;
1116 long tick;
1116 int written = 0; 1117 int written = 0;
1117 int samples; 1118 int samples;
1118 1119
@@ -1126,6 +1127,10 @@ int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count)
1126 if (new_gain) 1127 if (new_gain)
1127 dsp_set_replaygain(); /* Gain has changed */ 1128 dsp_set_replaygain(); /* Gain has changed */
1128 1129
1130 /* Perform at least one yield before starting */
1131 last_yield = current_tick;
1132 yield();
1133
1129 /* Testing function pointers for NULL is preferred since the pointer 1134 /* Testing function pointers for NULL is preferred since the pointer
1130 will be preloaded to be used for the call if not. */ 1135 will be preloaded to be used for the call if not. */
1131 while (count > 0) 1136 while (count > 0)
@@ -1162,10 +1167,11 @@ int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count)
1162 dst += samples * sizeof (int16_t) * 2; 1167 dst += samples * sizeof (int16_t) * 2;
1163 1168
1164 /* yield at least once each tick */ 1169 /* yield at least once each tick */
1165 if (current_tick > last_yield) 1170 tick = current_tick;
1171 if (TIME_AFTER(tick, last_yield))
1166 { 1172 {
1173 last_yield = tick;
1167 yield(); 1174 yield();
1168 last_yield = current_tick;
1169 } 1175 }
1170 } 1176 }
1171 1177