goto probeParameters;\r
}\r
}\r
+ else\r
+ snd_ctl_close( chandle );\r
\r
result = snd_pcm_open( &phandle, name, stream, openMode | SND_PCM_NONBLOCK);\r
if ( result < 0 ) {\r
\r
// Check that we have at least one supported format\r
if ( info.nativeFormats == 0 ) {\r
+ snd_pcm_close( phandle );\r
errorStream_ << "RtApiAlsa::getDeviceInfo: pcm device (" << name << ") data format not supported by RtAudio.";\r
errorText_ = errorStream_.str();\r
error( RtAudioError::WARNING );\r
// Get the device name\r
char *cardname;\r
result = snd_card_get_name( card, &cardname );\r
- if ( result >= 0 )\r
+ if ( result >= 0 ) {\r
sprintf( name, "hw:%s,%d", cardname, subdevice );\r
+ free( cardname );\r
+ }\r
info.name = name;\r
\r
// That's all ... close the device and return\r
\brief Exception handling class for RtAudio.
The RtAudioError class is quite simple but it does allow errors to be
- "caught" by RtAudioError::Type. See the RtAudio and RtMidi
- documentation to know which methods can throw an RtAudioError.
-
+ "caught" by RtAudioError::Type. See the RtAudio documentation to know
+ which methods can throw an RtAudioError.
*/
/************************************************************************/