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
5d6e96e9
Commit
5d6e96e9
authored
Nov 05, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pulse: removed reconnect interval
The output thread automatically waits some time before retrying to open the device. Don't duplicate this check in the pulse plugin.
parent
3defcef5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
19 deletions
+2
-19
pulse_plugin.c
src/output/pulse_plugin.c
+2
-19
No files found.
src/output/pulse_plugin.c
View file @
5d6e96e9
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include <pulse/error.h>
#include <pulse/error.h>
#define MPD_PULSE_NAME "mpd"
#define MPD_PULSE_NAME "mpd"
#define CONN_ATTEMPT_INTERVAL 60
struct
pulse_data
{
struct
pulse_data
{
struct
audio_output
*
ao
;
struct
audio_output
*
ao
;
...
@@ -31,8 +30,6 @@ struct pulse_data {
...
@@ -31,8 +30,6 @@ struct pulse_data {
pa_simple
*
s
;
pa_simple
*
s
;
char
*
server
;
char
*
server
;
char
*
sink
;
char
*
sink
;
int
num_connect_attempts
;
time_t
last_connect_attempt
;
};
};
static
struct
pulse_data
*
pulse_new_data
(
void
)
static
struct
pulse_data
*
pulse_new_data
(
void
)
...
@@ -44,8 +41,6 @@ static struct pulse_data *pulse_new_data(void)
...
@@ -44,8 +41,6 @@ static struct pulse_data *pulse_new_data(void)
ret
->
s
=
NULL
;
ret
->
s
=
NULL
;
ret
->
server
=
NULL
;
ret
->
server
=
NULL
;
ret
->
sink
=
NULL
;
ret
->
sink
=
NULL
;
ret
->
num_connect_attempts
=
0
;
ret
->
last_connect_attempt
=
0
;
return
ret
;
return
ret
;
}
}
...
@@ -114,18 +109,8 @@ pulse_open(void *data, struct audio_format *audio_format)
...
@@ -114,18 +109,8 @@ pulse_open(void *data, struct audio_format *audio_format)
{
{
struct
pulse_data
*
pd
=
data
;
struct
pulse_data
*
pd
=
data
;
pa_sample_spec
ss
;
pa_sample_spec
ss
;
time_t
t
;
int
error
;
int
error
;
t
=
time
(
NULL
);
if
(
pd
->
num_connect_attempts
!=
0
&&
(
t
-
pd
->
last_connect_attempt
)
<
CONN_ATTEMPT_INTERVAL
)
return
false
;
pd
->
num_connect_attempts
++
;
pd
->
last_connect_attempt
=
t
;
/* MPD doesn't support the other pulseaudio sample formats, so
/* MPD doesn't support the other pulseaudio sample formats, so
we just force MPD to send us everything as 16 bit */
we just force MPD to send us everything as 16 bit */
audio_format
->
bits
=
16
;
audio_format
->
bits
=
16
;
...
@@ -140,14 +125,12 @@ pulse_open(void *data, struct audio_format *audio_format)
...
@@ -140,14 +125,12 @@ pulse_open(void *data, struct audio_format *audio_format)
&
error
);
&
error
);
if
(
!
pd
->
s
)
{
if
(
!
pd
->
s
)
{
g_warning
(
"Cannot connect to server in PulseAudio output "
g_warning
(
"Cannot connect to server in PulseAudio output "
"
\"
%s
\"
(attempt %i)
: %s
\n
"
,
"
\"
%s
\"
: %s
\n
"
,
audio_output_get_name
(
pd
->
ao
),
audio_output_get_name
(
pd
->
ao
),
p
d
->
num_connect_attempts
,
p
a_strerror
(
error
));
pa_strerror
(
error
));
return
false
;
return
false
;
}
}
pd
->
num_connect_attempts
=
0
;
g_debug
(
"PulseAudio output
\"
%s
\"
connected and playing %i bit, %i "
g_debug
(
"PulseAudio output
\"
%s
\"
connected and playing %i bit, %i "
"channel audio at %i Hz
\n
"
,
"channel audio at %i Hz
\n
"
,
audio_output_get_name
(
pd
->
ao
),
audio_output_get_name
(
pd
->
ao
),
...
...
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