Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
panelcontrol
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
minus
panelcontrol
Commits
a4dcd27b
Commit
a4dcd27b
authored
Sep 21, 2019
by
minus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use linked list for siso_watch_list elements
parent
c9539d27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
pa_siso_watch_list.c
pa_siso_watch_list.c
+9
-10
pa_siso_watch_list.h
pa_siso_watch_list.h
+2
-2
No files found.
pa_siso_watch_list.c
View file @
a4dcd27b
...
...
@@ -49,10 +49,7 @@ uint32_t siso_watch_get_first_or_default(struct siso_watch *w, uint32_t default_
}
struct
siso_watch
*
siso_add_name
(
struct
siso_watch_list
*
wl
,
const
char
*
name
)
{
wl
->
len
++
;
wl
->
items
=
realloc
(
wl
->
items
,
sizeof
(
struct
siso_watch
*
)
*
wl
->
len
);
struct
siso_watch
*
item
=
wl
->
items
[
wl
->
len
-
1
]
=
calloc
(
1
,
sizeof
(
struct
siso_watch
));
struct
siso_watch
*
item
=
calloc
(
1
,
sizeof
(
struct
siso_watch
));
item
->
name
=
strdup
(
name
);
item
->
target
=
-
1
;
item
->
mute
=
true
;
...
...
@@ -60,22 +57,24 @@ struct siso_watch *siso_add_name(struct siso_watch_list *wl, const char* name) {
item
->
sisos
.
items
=
NULL
;
item
->
volume_changed
=
NULL
;
item
->
userdata
=
NULL
;
item
->
next
=
wl
->
head
;
wl
->
head
=
item
;
return
item
;
}
struct
siso_watch
*
siso_get
(
struct
siso_watch_list
*
wl
,
const
char
*
name
)
{
for
(
s
ize_t
i
=
0
;
i
<
wl
->
len
;
i
++
)
{
int
offset
=
strlen
(
name
)
-
strlen
(
w
l
->
items
[
i
]
->
name
);
if
(
strcmp
(
w
l
->
items
[
i
]
->
name
,
name
+
offset
)
==
0
)
{
return
w
l
->
items
[
i
]
;
for
(
s
truct
siso_watch
*
w
=
wl
->
head
;
w
!=
NULL
;
w
=
w
->
next
)
{
int
offset
=
strlen
(
name
)
-
strlen
(
w
->
name
);
if
(
strcmp
(
w
->
name
,
name
+
offset
)
==
0
)
{
return
w
;
}
}
return
NULL
;
}
void
siso_remove_index
(
struct
siso_watch_list
*
wl
,
uint32_t
pa_index
)
{
for
(
s
ize_t
i
=
0
;
i
<
wl
->
len
;
i
++
)
{
siso_watch_remove_index
(
w
l
->
items
[
i
]
,
pa_index
);
for
(
s
truct
siso_watch
*
w
=
wl
->
head
;
w
!=
NULL
;
w
=
w
->
next
)
{
siso_watch_remove_index
(
w
,
pa_index
);
}
}
pa_siso_watch_list.h
View file @
a4dcd27b
...
...
@@ -14,6 +14,7 @@ struct siso {
};
struct
siso_watch
{
struct
siso_watch
*
next
;
const
char
*
name
;
uint32_t
target
;
// sink in case of watching a sink input
bool
mute
;
...
...
@@ -26,8 +27,7 @@ struct siso_watch {
};
struct
siso_watch_list
{
size_t
len
;
struct
siso_watch
**
items
;
struct
siso_watch
*
head
;
};
void
siso_watch_remove_index
(
struct
siso_watch
*
w
,
uint32_t
pa_index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment