Skip to content

Commit

Permalink
Rebase changes to frame.sample()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrick87 committed Feb 8, 2024
1 parent 78401bd commit 52af897
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ bool SndfileSink::has_clock() const {

void SndfileSink::write(audio::Frame& frame) {
roc_panic_if(!valid_);
const audio::sample_t* frame_data = frame.samples();
size_t frame_size = frame.num_samples();
const audio::sample_t* frame_data = frame.raw_samples();
size_t frame_size = frame.num_raw_samples();
audio::sample_t buffer_data[BUFFER_SIZE];
size_t buffer_pos = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ bool SndfileSource::read(audio::Frame& frame) {
roc_panic("sndfile source: read: non-open input file");
}

audio::sample_t * frame_data = frame.samples();
audio::sample_t * frame_data = frame.raw_samples();
size_t num_channels = (size_t)file_info_.channels;
sf_count_t frame_left = (sf_count_t)frame.num_samples();
sf_count_t samples_per_ch = (sf_count_t)(frame.num_samples() / num_channels);
sf_count_t frame_left = (sf_count_t)frame.num_raw_samples();
sf_count_t samples_per_ch = (sf_count_t)(frame.num_raw_samples() / num_channels);

sf_count_t n_samples = sf_read_float(file_, frame_data, frame_left);
if(sf_error(file_) != 0){
Expand All @@ -188,7 +188,7 @@ bool SndfileSource::read(audio::Frame& frame) {
}

if (n_samples < samples_per_ch) {
memset(frame.samples() + (unsigned long)n_samples * num_channels, 0,
memset(frame.raw_samples() + (unsigned long)n_samples * num_channels, 0,
(unsigned long)(samples_per_ch - n_samples) * num_channels * sizeof(audio::sample_t));
}

Expand Down

0 comments on commit 52af897

Please sign in to comment.