Skip to content

Commit

Permalink
Audio: ASRC: Fix the IPC3 incompatible pointer type
Browse files Browse the repository at this point in the history
Fix the IPC3 incompatible pointer type passing 'struct
timestamp_data *' to parameter of type 'struct dai_ts_data *',
which is found by ./scripts/fuzz.sh test.

Signed-off-by: Andrula Song <[email protected]>
  • Loading branch information
andrula-song authored and kv2019i committed Dec 15, 2023
1 parent 7e5d40a commit 3f572b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/audio/asrc/asrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ static inline bool asrc_get_asynchronous_mode(const struct ipc4_asrc_module_cfg
return false;
}

#if CONFIG_ZEPHYR_NATIVE_DRIVERS
int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd);
#else
int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd);
#endif

#else /*IPC3 version*/
typedef struct ipc_config_asrc ipc_asrc_cfg;

Expand All @@ -68,10 +62,13 @@ static inline bool asrc_get_asynchronous_mode(const struct ipc_config_asrc *ipc_
return ipc_asrc->asynchronous_mode;
}

int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd);

#endif

#if CONFIG_ZEPHYR_NATIVE_DRIVERS
int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd);
#else
int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd);
#endif
/* Simple count value to prevent first delta timestamp
* from being input to low-pass filter.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/audio/asrc/asrc_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ int asrc_dai_stop_timestamp(struct comp_data *cd)
return -EINVAL;
}

#if CONFIG_ZEPHYR_NATIVE_DRIVERS
int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd)
#else
int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd)
#endif
{
if (!cd->dai_dev)
return -EINVAL;
Expand Down

0 comments on commit 3f572b8

Please sign in to comment.