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
5a294955
Commit
5a294955
authored
Jan 29, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jack: make mpd_jack_connect() return bool
Return true/false instead of 1/-1.
parent
eccc7c21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
jack_plugin.c
src/output/jack_plugin.c
+10
-10
No files found.
src/output/jack_plugin.c
View file @
5a294955
...
@@ -55,7 +55,7 @@ struct jack_data {
...
@@ -55,7 +55,7 @@ struct jack_data {
jack_client_t
*
client
;
jack_client_t
*
client
;
jack_ringbuffer_t
*
ringbuffer
[
2
];
jack_ringbuffer_t
*
ringbuffer
[
2
];
int
bps
;
int
bps
;
int
shutdown
;
bool
shutdown
;
};
};
static
const
char
*
static
const
char
*
...
@@ -147,7 +147,7 @@ static void
...
@@ -147,7 +147,7 @@ static void
mpd_jack_shutdown
(
void
*
arg
)
mpd_jack_shutdown
(
void
*
arg
)
{
{
struct
jack_data
*
jd
=
(
struct
jack_data
*
)
arg
;
struct
jack_data
*
jd
=
(
struct
jack_data
*
)
arg
;
jd
->
shutdown
=
1
;
jd
->
shutdown
=
true
;
}
}
static
void
static
void
...
@@ -212,7 +212,7 @@ mpd_jack_test_default_device(void)
...
@@ -212,7 +212,7 @@ mpd_jack_test_default_device(void)
return
true
;
return
true
;
}
}
static
int
static
bool
mpd_jack_connect
(
struct
jack_data
*
jd
,
struct
audio_format
*
audio_format
)
mpd_jack_connect
(
struct
jack_data
*
jd
,
struct
audio_format
*
audio_format
)
{
{
jd
->
audio_format
=
audio_format
;
jd
->
audio_format
=
audio_format
;
...
@@ -225,7 +225,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
...
@@ -225,7 +225,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
if
((
jd
->
client
=
jack_client_new
(
mpd_jack_name
(
jd
)))
==
NULL
)
{
if
((
jd
->
client
=
jack_client_new
(
mpd_jack_name
(
jd
)))
==
NULL
)
{
g_warning
(
"jack server not running?"
);
g_warning
(
"jack server not running?"
);
return
-
1
;
return
false
;
}
}
jack_set_process_callback
(
jd
->
client
,
mpd_jack_process
,
jd
);
jack_set_process_callback
(
jd
->
client
,
mpd_jack_process
,
jd
);
...
@@ -239,13 +239,13 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
...
@@ -239,13 +239,13 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
if
(
jd
->
ports
[
i
]
==
NULL
)
{
if
(
jd
->
ports
[
i
]
==
NULL
)
{
g_warning
(
"Cannot register %s output port."
,
g_warning
(
"Cannot register %s output port."
,
port_names
[
i
]);
port_names
[
i
]);
return
-
1
;
return
false
;
}
}
}
}
if
(
jack_activate
(
jd
->
client
)
)
{
if
(
jack_activate
(
jd
->
client
)
)
{
g_warning
(
"cannot activate client"
);
g_warning
(
"cannot activate client"
);
return
-
1
;
return
false
;
}
}
if
(
jd
->
output_ports
[
1
]
==
NULL
)
{
if
(
jd
->
output_ports
[
1
]
==
NULL
)
{
...
@@ -257,7 +257,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
...
@@ -257,7 +257,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
JackPortIsPhysical
|
JackPortIsInput
);
JackPortIsPhysical
|
JackPortIsInput
);
if
(
jports
==
NULL
)
{
if
(
jports
==
NULL
)
{
g_warning
(
"no ports found"
);
g_warning
(
"no ports found"
);
return
-
1
;
return
false
;
}
}
jd
->
output_ports
[
0
]
=
g_strdup
(
jports
[
0
]);
jd
->
output_ports
[
0
]
=
g_strdup
(
jports
[
0
]);
...
@@ -276,11 +276,11 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
...
@@ -276,11 +276,11 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format)
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
g_warning
(
"%s is not a valid Jack Client / Port"
,
g_warning
(
"%s is not a valid Jack Client / Port"
,
jd
->
output_ports
[
i
]);
jd
->
output_ports
[
i
]);
return
-
1
;
return
false
;
}
}
}
}
return
1
;
return
true
;
}
}
static
bool
static
bool
...
@@ -290,7 +290,7 @@ mpd_jack_open(void *data, struct audio_format *audio_format)
...
@@ -290,7 +290,7 @@ mpd_jack_open(void *data, struct audio_format *audio_format)
assert
(
jd
!=
NULL
);
assert
(
jd
!=
NULL
);
if
(
jd
->
client
==
NULL
&&
mpd_jack_connect
(
jd
,
audio_format
)
<
0
)
{
if
(
jd
->
client
==
NULL
&&
!
mpd_jack_connect
(
jd
,
audio_format
)
)
{
mpd_jack_client_free
(
jd
);
mpd_jack_client_free
(
jd
);
return
false
;
return
false
;
}
}
...
...
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