Skip to content

Commit

Permalink
dcblock: remove buffer_acquire from dcblock
Browse files Browse the repository at this point in the history
remove buffer ops from dcblock module

this is a continuation of changes
from commit 4a03699

Signed-off-by: Tobiasz Dryjanski <[email protected]>
  • Loading branch information
tobonex committed Sep 19, 2023
1 parent ffac968 commit 33fa41c
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/audio/dcblock/dcblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ static inline void dcblock_set_frame_alignment(struct audio_stream *source,
static void dcblock_params(struct processing_module *mod)
{
struct sof_ipc_stream_params *params = mod->stream_params;
struct comp_buffer *sink_c, *source_c;
struct comp_buffer *sinkb, *sourceb;
struct comp_dev *dev = mod->dev;

Expand All @@ -231,14 +230,10 @@ static void dcblock_params(struct processing_module *mod)
component_set_nearest_period_frames(dev, params->rate);

sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
sink_c = buffer_acquire(sinkb);
ipc4_update_buffer_format(sink_c, &mod->priv.cfg.base_cfg.audio_fmt);
buffer_release(sink_c);
ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt);

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list);
source_c = buffer_acquire(sourceb);
ipc4_update_buffer_format(source_c, &mod->priv.cfg.base_cfg.audio_fmt);
buffer_release(source_c);
ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt);
}
#endif /* CONFIG_IPC_MAJOR_4 */

Expand All @@ -253,7 +248,6 @@ static int dcblock_prepare(struct processing_module *mod,
{
struct comp_data *cd = module_get_private_data(mod);
struct comp_buffer *sourceb, *sinkb;
struct comp_buffer *source_c, *sink_c;
struct comp_dev *dev = mod->dev;

comp_info(dev, "dcblock_prepare()");
Expand All @@ -266,18 +260,13 @@ static int dcblock_prepare(struct processing_module *mod,
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list);
sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);

source_c = buffer_acquire(sourceb);
sink_c = buffer_acquire(sinkb);

/* get source data format */
cd->source_format = audio_stream_get_frm_fmt(&source_c->stream);
cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream);

/* get sink data format and period bytes */
cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream);
cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream);

dcblock_set_frame_alignment(&source_c->stream, &sink_c->stream);
buffer_release(sink_c);
buffer_release(source_c);
dcblock_set_frame_alignment(&sourceb->stream, &sinkb->stream);

dcblock_init_state(cd);
cd->dcblock_func = dcblock_find_func(cd->source_format);
Expand Down

0 comments on commit 33fa41c

Please sign in to comment.