Skip to content

Commit

Permalink
Squash: all required PRs in one commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinszkudlinski committed Aug 17, 2023
1 parent fb6c3b7 commit 7b90d19
Show file tree
Hide file tree
Showing 16 changed files with 625 additions and 46 deletions.
13 changes: 12 additions & 1 deletion src/audio/audio_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ static int audio_stream_commit_buffer(struct sof_sink __sparse_cache *sink, size
struct audio_stream __sparse_cache *audio_stream =
attr_container_of(sink, struct audio_stream __sparse_cache,
sink_api, __sparse_cache);
struct comp_buffer __sparse_cache *buffer_c =
attr_container_of(audio_stream, struct comp_buffer __sparse_cache,
stream, __sparse_cache);

if (commit_size)
if (commit_size) {
buffer_stream_writeback(buffer_c, commit_size);
audio_stream_produce(audio_stream, commit_size);
}

return 0;
}
Expand All @@ -60,9 +65,15 @@ static int audio_stream_get_data(struct sof_source __sparse_cache *source, size_
attr_container_of(source, struct audio_stream __sparse_cache,
source_api, __sparse_cache);

struct comp_buffer __sparse_cache *buffer_c =
attr_container_of(audio_stream, struct comp_buffer __sparse_cache,
stream, __sparse_cache);

if (req_size > audio_stream_get_data_available(source))
return -ENODATA;

buffer_stream_invalidate(buffer_c, req_size);

/* get circular buffer parameters */
*data_ptr = audio_stream->r_ptr;
*buffer_start = audio_stream->addr;
Expand Down
Loading

0 comments on commit 7b90d19

Please sign in to comment.