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
ac830468
Commit
ac830468
authored
Oct 23, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/jack: implement methods enable()/disable()
Don't connect to JACK before MPD has daemonized.
parent
7547b117
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
jack_output_plugin.c
src/output/jack_output_plugin.c
+24
-16
No files found.
src/output/jack_output_plugin.c
View file @
ac830468
...
@@ -210,7 +210,6 @@ mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
...
@@ -210,7 +210,6 @@ mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
{
{
struct
jack_data
*
jd
;
struct
jack_data
*
jd
;
const
char
*
value
;
const
char
*
value
;
GError
*
error
=
NULL
;
jd
=
g_new
(
struct
jack_data
,
1
);
jd
=
g_new
(
struct
jack_data
,
1
);
jd
->
name
=
config_get_block_string
(
param
,
"name"
,
"mpd_jack"
);
jd
->
name
=
config_get_block_string
(
param
,
"name"
,
"mpd_jack"
);
...
@@ -240,22 +239,12 @@ mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
...
@@ -240,22 +239,12 @@ mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
jd
->
ringbuffer_size
=
jd
->
ringbuffer_size
=
config_get_block_unsigned
(
param
,
"ringbuffer_size"
,
32768
);
config_get_block_unsigned
(
param
,
"ringbuffer_size"
,
32768
);
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
jd
->
ringbuffer
);
++
i
)
jd
->
ringbuffer
[
i
]
=
NULL
;
jack_set_error_function
(
mpd_jack_error
);
jack_set_error_function
(
mpd_jack_error
);
#ifdef HAVE_JACK_SET_INFO_FUNCTION
#ifdef HAVE_JACK_SET_INFO_FUNCTION
jack_set_info_function
(
mpd_jack_info
);
jack_set_info_function
(
mpd_jack_info
);
#endif
#endif
if
(
!
mpd_jack_connect
(
jd
,
&
error
))
{
/* this is non-fatal - it's enough to connect when
playback starts */
g_warning
(
"%s"
,
error
->
message
);
g_error_free
(
error
);
}
return
jd
;
return
jd
;
}
}
...
@@ -264,6 +253,28 @@ mpd_jack_finish(void *data)
...
@@ -264,6 +253,28 @@ mpd_jack_finish(void *data)
{
{
struct
jack_data
*
jd
=
data
;
struct
jack_data
*
jd
=
data
;
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
jd
->
output_ports
);
++
i
)
g_free
(
jd
->
output_ports
[
i
]);
g_free
(
jd
);
}
static
bool
mpd_jack_enable
(
void
*
data
,
GError
**
error_r
)
{
struct
jack_data
*
jd
=
(
struct
jack_data
*
)
data
;
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
jd
->
ringbuffer
);
++
i
)
jd
->
ringbuffer
[
i
]
=
NULL
;
return
mpd_jack_connect
(
jd
,
error_r
);
}
static
void
mpd_jack_disable
(
void
*
data
)
{
struct
jack_data
*
jd
=
(
struct
jack_data
*
)
data
;
if
(
jd
->
client
!=
NULL
)
if
(
jd
->
client
!=
NULL
)
mpd_jack_disconnect
(
jd
);
mpd_jack_disconnect
(
jd
);
...
@@ -273,11 +284,6 @@ mpd_jack_finish(void *data)
...
@@ -273,11 +284,6 @@ mpd_jack_finish(void *data)
jd
->
ringbuffer
[
i
]
=
NULL
;
jd
->
ringbuffer
[
i
]
=
NULL
;
}
}
}
}
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
jd
->
output_ports
);
++
i
)
g_free
(
jd
->
output_ports
[
i
]);
g_free
(
jd
);
}
}
/**
/**
...
@@ -528,6 +534,8 @@ const struct audio_output_plugin jack_output_plugin = {
...
@@ -528,6 +534,8 @@ const struct audio_output_plugin jack_output_plugin = {
.
test_default_device
=
mpd_jack_test_default_device
,
.
test_default_device
=
mpd_jack_test_default_device
,
.
init
=
mpd_jack_init
,
.
init
=
mpd_jack_init
,
.
finish
=
mpd_jack_finish
,
.
finish
=
mpd_jack_finish
,
.
enable
=
mpd_jack_enable
,
.
disable
=
mpd_jack_disable
,
.
open
=
mpd_jack_open
,
.
open
=
mpd_jack_open
,
.
play
=
mpd_jack_play
,
.
play
=
mpd_jack_play
,
.
pause
=
mpd_jack_pause
,
.
pause
=
mpd_jack_pause
,
...
...
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