cwAudioDeviceAlsa.cpp : Removed trailing white space from the device description string.

This commit is contained in:
kevin 2024-09-19 15:06:56 -04:00
parent 05d0c316f4
commit bc98a92f0a

View File

@ -4,6 +4,7 @@
#include "cwTest.h"
#include "cwMem.h"
#include "cwTime.h"
#include "cwText.h"
#include "cwTextBuf.h"
#include "cwThread.h"
#include "cwAudioDevice.h"
@ -1302,7 +1303,10 @@ cw::rc_t cw::audio::device::alsa::create( handle_t& hRef, struct driver_str*& dr
// form the device name and desc. string
dr.nameStr = mem::printf(dr.nameStr,"hw:%i,%i,%i",cardNum,devNum,i);
dr.descStr = mem::printf(dr.descStr,"%s %s",cardNamePtr,snd_pcm_info_get_name(info));
// it's possible that trailing whitespace is left in the desc
removeTrailingWhitespace( dr.descStr );
// attempt to open the sub-device
if((err = _devOpen(&pcmH,dr.nameStr,inputFl)) < 0 )
_alsaSetupError(err,inputFl,&dr,"Unable to open the PCM handle");