mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
treewide: add some examples for the spa_auto* macros
This commit is contained in:
parent
65d949558b
commit
fe45786a5d
16 changed files with 136 additions and 236 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <spa/utils/json.h>
|
||||
#include <spa/debug/types.h>
|
||||
|
||||
#include <pipewire/cleanup.h>
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <pipewire/i18n.h>
|
||||
#include <pipewire/extensions/metadata.h>
|
||||
|
|
@ -603,7 +604,6 @@ static unsigned int find_channel(const char *name)
|
|||
static int parse_channelmap(const char *channel_map, struct channelmap *map)
|
||||
{
|
||||
int i, nch;
|
||||
char **ch;
|
||||
|
||||
SPA_FOR_EACH_ELEMENT_VAR(maps, m) {
|
||||
if (spa_streq(m->name, channel_map)) {
|
||||
|
|
@ -614,7 +614,7 @@ static int parse_channelmap(const char *channel_map, struct channelmap *map)
|
|||
}
|
||||
}
|
||||
|
||||
ch = pw_split_strv(channel_map, ",", SPA_AUDIO_MAX_CHANNELS, &nch);
|
||||
spa_auto(pw_strv) ch = pw_split_strv(channel_map, ",", SPA_AUDIO_MAX_CHANNELS, &nch);
|
||||
if (ch == NULL)
|
||||
return -1;
|
||||
|
||||
|
|
@ -623,7 +623,7 @@ static int parse_channelmap(const char *channel_map, struct channelmap *map)
|
|||
int c = find_channel(ch[i]);
|
||||
map->channels[i] = c;
|
||||
}
|
||||
pw_free_strv(ch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue