Skip to content

Commit 53c6bac

Browse files
lyakhkv2019i
authored andcommitted
host: fix processed data reporting
In component's .get_total_data_processed() method the "input" parameter means "calculate the direction where I am input." I.e. if it's true, the method should return processed data on its output, and if false - on its input. Since the host has only one direction, it should only return data when the direction matches, i.e. when input == true for playback and false for capture. The current implementation has that check inverted. Fix both Zephyr and legacy versions. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent e1e5fd0 commit 53c6bac

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/audio/host-legacy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ static uint64_t host_get_processed_data(struct comp_dev *dev, uint32_t stream_no
10611061
{
10621062
struct host_data *hd = comp_get_drvdata(dev);
10631063
uint64_t ret = 0;
1064-
bool source = dev->direction == SOF_IPC_STREAM_CAPTURE;
1064+
bool source = dev->direction == SOF_IPC_STREAM_PLAYBACK;
10651065

10661066
/* Return value only if direction and stream number match.
10671067
* The host supports only one stream.

src/audio/host-zephyr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ static uint64_t host_get_processed_data(struct comp_dev *dev, uint32_t stream_no
11011101
{
11021102
struct host_data *hd = comp_get_drvdata(dev);
11031103
uint64_t ret = 0;
1104-
bool source = dev->direction == SOF_IPC_STREAM_CAPTURE;
1104+
bool source = dev->direction == SOF_IPC_STREAM_PLAYBACK;
11051105

11061106
/* Return value only if direction and stream number match.
11071107
* The host supports only one stream.

0 commit comments

Comments
 (0)