@@ -80,8 +80,8 @@ static void eq_iir_s16_default(struct processing_module *mod, struct input_strea
8080 const int samples = frames * nch ;
8181 int processed = 0 ;
8282
83- bsource -> consumed += samples << 1 ;
84- bsink -> size += samples << 1 ;
83+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S16_LE ,
84+ SOF_IPC_FRAME_S16_LE , samples ) ;
8585
8686 x = source -> r_ptr ;
8787 y = sink -> w_ptr ;
@@ -131,8 +131,8 @@ static void eq_iir_s24_default(struct processing_module *mod, struct input_strea
131131 const int samples = frames * nch ;
132132 int processed = 0 ;
133133
134- bsource -> consumed += S32_SAMPLES_TO_BYTES ( samples );
135- bsink -> size += S32_SAMPLES_TO_BYTES ( samples );
134+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
135+ SOF_IPC_FRAME_S32_LE , samples );
136136
137137 x = source -> r_ptr ;
138138 y = sink -> w_ptr ;
@@ -182,8 +182,8 @@ static void eq_iir_s32_default(struct processing_module *mod, struct input_strea
182182 const int samples = frames * nch ;
183183 int processed = 0 ;
184184
185- bsource -> consumed += S32_SAMPLES_TO_BYTES ( samples );
186- bsink -> size += S32_SAMPLES_TO_BYTES ( samples );
185+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
186+ SOF_IPC_FRAME_S32_LE , samples );
187187
188188 x = source -> r_ptr ;
189189 y = sink -> w_ptr ;
@@ -233,8 +233,8 @@ static void eq_iir_s32_16_default(struct processing_module *mod,
233233 const int samples = frames * nch ;
234234 int processed = 0 ;
235235
236- bsource -> consumed += S32_SAMPLES_TO_BYTES ( samples );
237- bsink -> size += S16_SAMPLES_TO_BYTES ( samples );
236+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
237+ SOF_IPC_FRAME_S16_LE , samples );
238238
239239 x = source -> r_ptr ;
240240 y = sink -> w_ptr ;
@@ -284,8 +284,8 @@ static void eq_iir_s32_24_default(struct processing_module *mod,
284284 const int samples = frames * nch ;
285285 int processed = 0 ;
286286
287- bsource -> consumed += S32_SAMPLES_TO_BYTES ( samples );
288- bsink -> size += S32_SAMPLES_TO_BYTES ( samples );
287+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
288+ SOF_IPC_FRAME_S32_LE , samples );
289289
290290 x = source -> r_ptr ;
291291 y = sink -> w_ptr ;
@@ -318,13 +318,12 @@ static void eq_iir_pass(struct processing_module *mod, struct input_stream_buffe
318318 struct audio_stream __sparse_cache * source = bsource -> data ;
319319 struct audio_stream __sparse_cache * sink = bsink -> data ;
320320
321- if (source -> frame_fmt == SOF_IPC_FRAME_S16_LE ) {
322- bsource -> consumed += S16_SAMPLES_TO_BYTES (frames * source -> channels );
323- bsink -> size += S16_SAMPLES_TO_BYTES (frames * source -> channels );
324- } else {
325- bsource -> consumed += S32_SAMPLES_TO_BYTES (frames * source -> channels );
326- bsink -> size += S32_SAMPLES_TO_BYTES (frames * source -> channels );
327- }
321+ if (source -> frame_fmt == SOF_IPC_FRAME_S16_LE )
322+ module_update_processing_position (bsource , bsink , SOF_IPC_FRAME_S16_LE ,
323+ SOF_IPC_FRAME_S16_LE , frames * source -> channels );
324+ else
325+ module_update_processing_position (bsource , bsink , SOF_IPC_FRAME_S32_LE ,
326+ SOF_IPC_FRAME_S32_LE , frames * source -> channels );
328327
329328 audio_stream_copy (source , 0 , sink , 0 , frames * source -> channels );
330329}
@@ -342,8 +341,8 @@ static void eq_iir_s32_s16_pass(struct processing_module *mod, struct input_stre
342341 int i ;
343342 int remaining_samples = frames * source -> channels ;
344343
345- bsource -> consumed += S32_SAMPLES_TO_BYTES ( remaining_samples );
346- bsink -> size += S16_SAMPLES_TO_BYTES ( remaining_samples );
344+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
345+ SOF_IPC_FRAME_S16_LE , remaining_samples );
347346
348347 while (remaining_samples ) {
349348 nmax = BYTES_TO_S32_SAMPLES (audio_stream_bytes_without_wrap (source , x ));
@@ -375,8 +374,8 @@ static void eq_iir_s32_s24_pass(struct processing_module *mod, struct input_stre
375374 int i ;
376375 int remaining_samples = frames * source -> channels ;
377376
378- bsource -> consumed += S32_SAMPLES_TO_BYTES ( remaining_samples );
379- bsink -> size += S32_SAMPLES_TO_BYTES ( remaining_samples );
377+ module_update_processing_position ( bsource , bsink , SOF_IPC_FRAME_S32_LE ,
378+ SOF_IPC_FRAME_S32_LE , remaining_samples );
380379
381380 while (remaining_samples ) {
382381 nmax = BYTES_TO_S32_SAMPLES (audio_stream_bytes_without_wrap (source , x ));
0 commit comments