From 62d043e2cf302772cc817af766a47de8cc1e2d81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Damian=20Kara=C5=9B?= <s176030@student.pg.edu.pl>
Date: Sun, 7 Nov 2021 21:40:52 +0100
Subject: [PATCH] src/cpp/ALSA_support.cpp: corrected arguments assignment
 order
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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cpp/ALSA_support.cpp b/src/cpp/ALSA_support.cpp
index 236b1cc..43cfce7 100644
--- a/src/cpp/ALSA_support.cpp
+++ b/src/cpp/ALSA_support.cpp
@@ -648,9 +648,9 @@ long DSP::ALSA_object_t::open_PCM_device_4_output(const int &no_of_channels, int
 {
   int rc;
 
+  no_of_channels_alsa = (unsigned int) no_of_channels;
   no_of_bytes_in_channel = (unsigned int) no_of_bits / 8;
   sampling_rate_alsa = (unsigned int) sampling_rate;
-  no_of_channels_alsa = (unsigned int) no_of_channels;
   audio_inbuffer_size_in_frames = (snd_pcm_uframes_t) audio_outbuffer_size;
 
   rc = open_alsa_device(SND_PCM_STREAM_PLAYBACK);
@@ -658,7 +658,7 @@ long DSP::ALSA_object_t::open_PCM_device_4_output(const int &no_of_channels, int
   if(rc > 0)
   { 
     IsDeviceOutputOpen = true;
-    return sampling_rate_alsa;
+    return (long) sampling_rate_alsa;
   }
   
   else 
@@ -672,9 +672,9 @@ long DSP::ALSA_object_t::open_PCM_device_4_input(const int &no_of_channels, int
 {
   int rc;
 
+  no_of_channels_alsa = (unsigned int) no_of_channels;
   no_of_bytes_in_channel = (unsigned int) no_of_bits / 8;
   sampling_rate_alsa = (unsigned int) sampling_rate;
-  no_of_channels_alsa = (unsigned int) no_of_channels;
   audio_inbuffer_size_in_frames = (snd_pcm_uframes_t) audio_inbuffer_size;
 
   rc = open_alsa_device(SND_PCM_STREAM_CAPTURE);
@@ -682,7 +682,7 @@ long DSP::ALSA_object_t::open_PCM_device_4_input(const int &no_of_channels, int
   if(rc > 0)
   { 
     IsDeviceInputOpen = true;
-    return sampling_rate_alsa;
+    return (long) sampling_rate_alsa;
   }  
   else 
   {
-- 
GitLab