From f765cfd8e622059db93924689464f2624085df86 Mon Sep 17 00:00:00 2001 From: Hunter Date: Wed, 28 Feb 2024 16:01:15 -0800 Subject: [PATCH] forgot scons fmt --- src/internal_modules/roc_audio/sample_spec.cpp | 3 +-- .../roc_sndio/target_sox/roc_sndio/sox_source.cpp | 12 +++++------- src/internal_modules/roc_sndio/wav_source.cpp | 2 +- src/tests/roc_sndio/test_backend_source.cpp | 6 ++---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/internal_modules/roc_audio/sample_spec.cpp b/src/internal_modules/roc_audio/sample_spec.cpp index 357d644d0..de2e717b3 100644 --- a/src/internal_modules/roc_audio/sample_spec.cpp +++ b/src/internal_modules/roc_audio/sample_spec.cpp @@ -138,8 +138,7 @@ bool SampleSpec::is_valid() const { } bool SampleSpec::is_empty() const { - return sample_fmt_ == SampleFormat_Invalid - && pcm_fmt_ == PcmFormat_Invalid + return sample_fmt_ == SampleFormat_Invalid && pcm_fmt_ == PcmFormat_Invalid && sample_rate_ == 0 && channel_set_.num_channels() == 0; } diff --git a/src/internal_modules/roc_sndio/target_sox/roc_sndio/sox_source.cpp b/src/internal_modules/roc_sndio/target_sox/roc_sndio/sox_source.cpp index 9bb5f7711..3b5a3743e 100644 --- a/src/internal_modules/roc_sndio/target_sox/roc_sndio/sox_source.cpp +++ b/src/internal_modules/roc_sndio/target_sox/roc_sndio/sox_source.cpp @@ -32,9 +32,8 @@ SoxSource::SoxSource(core::IArena& arena, const Config& config) } frame_length_ = config.frame_length; - - sample_spec_ = config.sample_spec; + sample_spec_ = config.sample_spec; if (frame_length_ == 0) { roc_log(LogError, "sox source: frame length is zero"); @@ -116,7 +115,7 @@ void SoxSource::pause() { roc_log(LogDebug, "sox source: pausing: driver=%s input=%s", driver_name_.c_str(), input_name_.c_str()); - if(!is_file_){ + if (!is_file_) { close_(); } @@ -160,7 +159,7 @@ bool SoxSource::restart() { return false; } } else { - if(is_file_){ + if (is_file_) { sample_spec_.clear(); } @@ -363,13 +362,12 @@ bool SoxSource::open_() { is_file_ = !(input_->handler.flags & SOX_FILE_DEVICE); if (is_file_) { - if(!sample_spec_.is_empty()){ + if (!sample_spec_.is_empty()) { roc_log(LogError, "sox source: setting io encoding for files not supported"); return false; } sample_spec_ = sample_spec(); - } - else{ + } else { if (input_->signal.channels != sample_spec_.num_channels()) { roc_log(LogError, "sox source: can't open: unsupported # of channels: " diff --git a/src/internal_modules/roc_sndio/wav_source.cpp b/src/internal_modules/roc_sndio/wav_source.cpp index 458d3564a..e00353d64 100644 --- a/src/internal_modules/roc_sndio/wav_source.cpp +++ b/src/internal_modules/roc_sndio/wav_source.cpp @@ -14,7 +14,7 @@ namespace roc { namespace sndio { WavSource::WavSource(core::IArena& arena, const Config& config) - : file_opened_(false) + : file_opened_(false) , eof_(false) , valid_(false) { if (config.latency != 0) { diff --git a/src/tests/roc_sndio/test_backend_source.cpp b/src/tests/roc_sndio/test_backend_source.cpp index 75e64f6c2..6288b7278 100644 --- a/src/tests/roc_sndio/test_backend_source.cpp +++ b/src/tests/roc_sndio/test_backend_source.cpp @@ -219,7 +219,7 @@ TEST(backend_source, sample_rate_mismatch) { IDevice* backend_device = backend.open_device( DeviceType_Source, DriverType_File, "wav", file.path(), source_config, arena); - + CHECK(backend_device == NULL); } } @@ -329,7 +329,7 @@ TEST(backend_source, pause_restart) { audio::Frame frame1(frame_data1, FrameSize * NumChans); // TODO(gh-706): check state - + CHECK(backend_source->read(frame1)); backend_source->pause(); @@ -357,8 +357,6 @@ TEST(backend_source, pause_restart) { CHECK(backend_source->read(frame2)); } - - if (memcmp(frame_data1, frame_data2, sizeof(frame_data1)) != 0) { FAIL("frames should be equal"); }