mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly. Use this in places where we use asprintf to avoid warnings when we don't check the return value.
This commit is contained in:
parent
aee3191bad
commit
6ac9b7b3a7
16 changed files with 102 additions and 85 deletions
|
|
@ -796,11 +796,14 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name,
|
|||
pw->flags = flags;
|
||||
|
||||
if (node_name == NULL)
|
||||
err = asprintf(&pw->node_name, "ALSA %s",
|
||||
pw->node_name = spa_aprintf("ALSA %s",
|
||||
stream == SND_PCM_STREAM_PLAYBACK ? "Playback" : "Capture");
|
||||
else
|
||||
pw->node_name = strdup(node_name);
|
||||
|
||||
if (pw->node_name == NULL)
|
||||
return -errno;
|
||||
|
||||
pw->target = PW_ID_ANY;
|
||||
if (str != NULL)
|
||||
pw->target = atoi(str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue