Skip to content

Commit

Permalink
volume: use comp_get_copy_limits_with_lock
Browse files Browse the repository at this point in the history
Simplifies the code and fixes single-flags issue.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
  • Loading branch information
Marcin Maka authored and lgirdwood committed Apr 7, 2020
1 parent c94b070 commit 8194b7c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ static int volume_copy(struct comp_dev *dev)
struct comp_data *cd = comp_get_drvdata(dev);
struct comp_buffer *source;
struct comp_buffer *sink;
uint32_t flags = 0;

comp_dbg(dev, "volume_copy()");

Expand All @@ -664,14 +663,8 @@ static int volume_copy(struct comp_dev *dev)
sink = list_first_item(&dev->bsink_list, struct comp_buffer,
source_list);

buffer_lock(source, &flags);
buffer_lock(sink, &flags);

/* Get source, sink, number of frames etc. to process. */
comp_get_copy_limits(source, sink, &c);

buffer_unlock(sink, flags);
buffer_unlock(source, flags);
comp_get_copy_limits_with_lock(source, sink, &c);

comp_dbg(dev, "volume_copy(), source_bytes = 0x%x, sink_bytes = 0x%x",
c.source_bytes, c.sink_bytes);
Expand Down

0 comments on commit 8194b7c

Please sign in to comment.