diff --git a/src/cpp/ALSA_support.cpp b/src/cpp/ALSA_support.cpp index b4d55b1aee8eb3fde77bc4776d29aa64612564e5..1b3d7e7ee001e47e50ab1e1b96ed9f0625144e6b 100644 --- a/src/cpp/ALSA_support.cpp +++ b/src/cpp/ALSA_support.cpp @@ -859,7 +859,7 @@ bool DSP::ALSA_object_t::stop_playback(void) StopPlayback = true; snd_pcm_sframes_t rc; - snd_pcm_sframes_t buffer_size_in_frames = (snd_pcm_sframes_t) pcm_buffer.size(); // M.B. wrong value + snd_pcm_sframes_t buffer_size_in_frames; // if there are still buffers that haven't been yet sent to sound card then do it now if (IsPlayingNow == false) @@ -873,7 +873,8 @@ bool DSP::ALSA_object_t::stop_playback(void) // send all data from buffers to soundcard to start playback for (unsigned int ind = 0; ind < NextBufferOutInd; ind++) //one spare buffer { - rc = DSP::ALSA_object_t::pcm_writei(pcm_buffer[ind], buffer_size_in_frames); + buffer_size_in_frames = pcm_buffer_size_in_frames[ind]; + rc = DSP::ALSA_object_t::pcm_writei(pcm_buffer[ind], buffer_size_in_frames); } if (rc > 0) IsPlayingNow = true; diff --git a/src/include/ALSA_support.h b/src/include/ALSA_support.h index 683421b08470b7bdaa00d1acb9b498ef9250df35..2c5c734bfdf75b6525583cfecf41755e1af15799 100644 --- a/src/include/ALSA_support.h +++ b/src/include/ALSA_support.h @@ -65,9 +65,9 @@ namespace DSP { //! CPU architecture - endianness bool IsLittleEndian; - //! Is PCM device openned for recording? + //! Is the PCM device opened for recording? bool IsDeviceInputOpen; - //! Is PCM device openned for playback? + //! Is the PCM device opened for playback? bool IsDeviceOutputOpen; //! Has playback already started?