mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-23 04:05:36 +00:00
Merge pull request #56 from clehner/master
Handle ALSA devices with null description
This commit is contained in:
commit
376ba4a4e6
|
@ -79,6 +79,8 @@ static inline snd_pcm_uframes_t ceil_dbl_to_uframes(double x) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static char * str_partition_on_char(char *str, char c) {
|
static char * str_partition_on_char(char *str, char c) {
|
||||||
|
if (!str)
|
||||||
|
return NULL;
|
||||||
while (*str) {
|
while (*str) {
|
||||||
if (*str == c) {
|
if (*str == c) {
|
||||||
*str = 0;
|
*str = 0;
|
||||||
|
@ -573,7 +575,8 @@ static int refresh_devices(struct SoundIoPrivate *si) {
|
||||||
device->is_raw = false;
|
device->is_raw = false;
|
||||||
device->id = strdup(name);
|
device->id = strdup(name);
|
||||||
device->name = descr1 ?
|
device->name = descr1 ?
|
||||||
soundio_alloc_sprintf(NULL, "%s: %s", descr, descr1) : strdup(descr);
|
soundio_alloc_sprintf(NULL, "%s: %s", descr, descr1) : descr ?
|
||||||
|
strdup(descr) : strdup(name);
|
||||||
|
|
||||||
if (!device->id || !device->name) {
|
if (!device->id || !device->name) {
|
||||||
soundio_device_unref(device);
|
soundio_device_unref(device);
|
||||||
|
|
Loading…
Reference in a new issue