Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5bcf415a
Commit
5bcf415a
authored
Jan 29, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jack: use jack_port_name() instead of g_malloc()+sprintf()
libjack's jack_port_name() function returns the effective port name, we don't need to do it manually.
parent
67cf2ee6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
jack_plugin.c
src/output/jack_plugin.c
+2
-12
No files found.
src/output/jack_plugin.c
View file @
5bcf415a
...
@@ -215,7 +215,6 @@ static int
...
@@ -215,7 +215,6 @@ static int
mpd_jack_connect
(
struct
jack_data
*
jd
,
struct
audio_format
*
audio_format
)
mpd_jack_connect
(
struct
jack_data
*
jd
,
struct
audio_format
*
audio_format
)
{
{
const
char
**
jports
;
const
char
**
jports
;
char
*
port_name
;
jd
->
audio_format
=
audio_format
;
jd
->
audio_format
=
audio_format
;
...
@@ -267,27 +266,18 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
...
@@ -267,27 +266,18 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
}
}
if
(
jd
->
output_ports
[
1
]
)
{
if
(
jd
->
output_ports
[
1
]
)
{
const
char
*
name
=
mpd_jack_name
(
jd
);
if
(
(
jack_connect
(
jd
->
client
,
jack_port_name
(
jd
->
ports
[
0
]),
port_name
=
g_malloc
(
sizeof
(
port_name
[
0
])
*
(
7
+
strlen
(
name
)));
sprintf
(
port_name
,
"%s:left"
,
name
);
if
(
(
jack_connect
(
jd
->
client
,
port_name
,
jd
->
output_ports
[
0
]))
!=
0
)
{
jd
->
output_ports
[
0
]))
!=
0
)
{
g_warning
(
"%s is not a valid Jack Client / Port"
,
g_warning
(
"%s is not a valid Jack Client / Port"
,
jd
->
output_ports
[
0
]);
jd
->
output_ports
[
0
]);
g_free
(
port_name
);
return
-
1
;
return
-
1
;
}
}
sprintf
(
port_name
,
"%s:right"
,
name
);
if
(
(
jack_connect
(
jd
->
client
,
jack_port_name
(
jd
->
ports
[
0
]),
if
(
(
jack_connect
(
jd
->
client
,
port_name
,
jd
->
output_ports
[
1
]))
!=
0
)
{
jd
->
output_ports
[
1
]))
!=
0
)
{
g_warning
(
"%s is not a valid Jack Client / Port"
,
g_warning
(
"%s is not a valid Jack Client / Port"
,
jd
->
output_ports
[
1
]);
jd
->
output_ports
[
1
]);
g_free
(
port_name
);
return
-
1
;
return
-
1
;
}
}
g_free
(
port_name
);
}
}
return
1
;
return
1
;
...
...
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