From 52af897bfa0e1c11737becc8c2dd1442640ee69c Mon Sep 17 00:00:00 2001 From: Hunter Date: Thu, 8 Feb 2024 12:16:19 -0800 Subject: [PATCH] Rebase changes to frame.sample() --- .../roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp | 4 ++-- .../roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp index bdf75ed4c..95e71f91b 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_sink.cpp @@ -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; diff --git a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp index e6b9fa476..1aab39f69 100644 --- a/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp +++ b/src/internal_modules/roc_sndio/target_sndfile/roc_sndio/sndfile_source.cpp @@ -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){ @@ -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)); }