From e31593bedc728576621c8ff67373b1343fc2224a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kara=C5=9B?= <s176030@student.pg.edu.pl> Date: Thu, 4 Nov 2021 17:59:05 +0100 Subject: [PATCH] src/cpp/ALSA_support.cpp: minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Damian KaraĹ <s176030@student.pg.edu.pl> --- src/cpp/ALSA_support.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cpp/ALSA_support.cpp b/src/cpp/ALSA_support.cpp index 5ee7bcf..786a48c 100644 --- a/src/cpp/ALSA_support.cpp +++ b/src/cpp/ALSA_support.cpp @@ -18,10 +18,10 @@ DSP::ALSA_object_t::ALSA_object_t() alsa_handle = NULL; hw_params = NULL; - std::string endianess; - endianess = system("lscpu | grep \"Byte Order\" | egrep -o 'Little Endian|Big Endian'"); + std::string endianness; + endianness = system("lscpu | grep \"Byte Order\" | egrep -o 'Little Endian|Big Endian'"); - if (endianess == "Big Endian") + if (endianness == "Big Endian") IsLittleEndian = false; else IsLittleEndian = true; @@ -65,6 +65,7 @@ DSP::ALSA_object_t::~ALSA_object_t() buffers_8bit.clear(); buffers_16bit.clear(); buffers_32bit.clear(); + buffers_32bit_f.clear(); buffers_64bit.clear(); pcm_buffer.clear(); pcm_buffer_size_in_frames.clear(); @@ -582,7 +583,7 @@ long DSP::ALSA_object_t::open_PCM_device_4_output(const int &no_of_channels, int if(rc > 0) { IsDeviceOutputOpen = true; - return 1; + return sampling_rate_alsa; } else @@ -606,7 +607,7 @@ long DSP::ALSA_object_t::open_PCM_device_4_input(const int &no_of_channels, int if(rc > 0) { IsDeviceInputOpen = true; - return 1; + return sampling_rate_alsa; } else { @@ -904,7 +905,7 @@ void DSP::ALSA_object_t::close_alsa_device(bool do_drain, bool use_log) if (use_log == true) { - DSP::log << "ALSA PCM sound closed" << endl; + DSP::log << "ALSA PCM sound closed." << endl; } IsDeviceInputOpen = false; -- GitLab