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
6f2be472
Commit
6f2be472
authored
Jun 12, 2007
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the shout timeout configurable. The default is still 2 seconds.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@6556
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
3c5cecb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
mpd.conf.5
doc/mpd.conf.5
+4
-0
mpdconf.example
doc/mpdconf.example
+1
-0
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+13
-2
No files found.
doc/mpd.conf.5
View file @
6f2be472
...
@@ -375,6 +375,10 @@ default is "source".
...
@@ -375,6 +375,10 @@ default is "source".
This specifies whether to request that the stream be listed in all public
This specifies whether to request that the stream be listed in all public
stream directories that the icecast server knows about. The default is no.
stream directories that the icecast server knows about. The default is no.
.TP
.TP
.B timeout <seconds>
This specifies the number of seconds to wait before giving up on trying to
connect to the icecast server. The default is 2 seconds.
.TP
.B description <description>
.B description <description>
This specifies a description of the stream.
This specifies a description of the stream.
.TP
.TP
...
...
doc/mpdconf.example
View file @
6f2be472
...
@@ -124,6 +124,7 @@ error_file "~/.mpd/mpd.error"
...
@@ -124,6 +124,7 @@ error_file "~/.mpd/mpd.error"
# description "My Stream Description" # optional
# description "My Stream Description" # optional
# genre "jazz" # optional
# genre "jazz" # optional
# public "no" # optional
# public "no" # optional
# timeout "2" # optional
#}
#}
#
#
# An example of a null output (for no audio output):
# An example of a null output (for no audio output):
...
...
src/audioOutputs/audioOutput_shout.c
View file @
6f2be472
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include <vorbis/vorbisenc.h>
#include <vorbis/vorbisenc.h>
#define CONN_ATTEMPT_INTERVAL 60
#define CONN_ATTEMPT_INTERVAL 60
#define
CONN_TIMEOUT
2
#define
DEFAULT_CONN_TIMEOUT
2
static
int
shoutInitCount
;
static
int
shoutInitCount
;
...
@@ -63,6 +63,7 @@ typedef struct _ShoutData {
...
@@ -63,6 +63,7 @@ typedef struct _ShoutData {
MpdTag
*
tag
;
MpdTag
*
tag
;
int
tagToSend
;
int
tagToSend
;
int
timeout
;
int
connAttempts
;
int
connAttempts
;
time_t
lastAttempt
;
time_t
lastAttempt
;
...
@@ -80,6 +81,7 @@ static ShoutData *newShoutData(void)
...
@@ -80,6 +81,7 @@ static ShoutData *newShoutData(void)
ret
->
tagToSend
=
0
;
ret
->
tagToSend
=
0
;
ret
->
bitrate
=
-
1
;
ret
->
bitrate
=
-
1
;
ret
->
quality
=
-
2
.
0
;
ret
->
quality
=
-
2
.
0
;
ret
->
timeout
=
DEFAULT_CONN_TIMEOUT
;
ret
->
connAttempts
=
0
;
ret
->
connAttempts
=
0
;
ret
->
lastAttempt
=
0
;
ret
->
lastAttempt
=
0
;
ret
->
audioFormat
=
NULL
;
ret
->
audioFormat
=
NULL
;
...
@@ -221,6 +223,15 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
...
@@ -221,6 +223,15 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
}
}
/* optional paramters */
/* optional paramters */
blockParam
=
getBlockParam
(
param
,
"timeout"
);
if
(
blockParam
)
{
sd
->
timeout
=
strtod
(
blockParam
->
value
,
&
test
);
if
(
*
test
!=
'\0'
||
sd
->
timeout
<=
0
)
{
FATAL
(
"shout timeout is not a positive integer, "
"line %i
\n
"
,
blockParam
->
line
);
}
}
blockParam
=
getBlockParam
(
param
,
"genre"
);
blockParam
=
getBlockParam
(
param
,
"genre"
);
if
(
blockParam
&&
shout_set_genre
(
sd
->
shoutConn
,
blockParam
->
value
))
{
if
(
blockParam
&&
shout_set_genre
(
sd
->
shoutConn
,
blockParam
->
value
))
{
FATAL
(
"error configuring shout defined at line %i: %s
\n
"
,
FATAL
(
"error configuring shout defined at line %i: %s
\n
"
,
...
@@ -451,7 +462,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput)
...
@@ -451,7 +462,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput)
state
=
shout_open
(
sd
->
shoutConn
);
state
=
shout_open
(
sd
->
shoutConn
);
while
(
state
==
SHOUTERR_BUSY
&&
(
t
-
sd
->
lastAttempt
)
<
CONN_TIMEOUT
)
{
while
(
state
==
SHOUTERR_BUSY
&&
(
t
-
sd
->
lastAttempt
)
<
sd
->
timeout
)
{
my_usleep
(
10000
);
my_usleep
(
10000
);
state
=
shout_get_connected
(
sd
->
shoutConn
);
state
=
shout_get_connected
(
sd
->
shoutConn
);
t
=
time
(
NULL
);
t
=
time
(
NULL
);
...
...
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