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
2c9b50ca
Commit
2c9b50ca
authored
Nov 02, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only attempt to reconnect to shout server every 60 seconds
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2472
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
82cb5e09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+21
-6
No files found.
src/audioOutputs/audioOutput_shout.c
View file @
2c9b50ca
...
...
@@ -30,11 +30,14 @@
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <time.h>
#include <shout/shout.h>
#include <vorbis/vorbisenc.h>
#include <vorbis/codec.h>
#define CONN_ATTEMPT_INTERVAL 60
static
int
shoutInitCount
=
0
;
/* lots of this code blatantly stolent from bossogg/bossao2 */
...
...
@@ -68,6 +71,9 @@ typedef struct _ShoutData {
MpdTag
*
tag
;
int
tagToSend
;
int
connAttempts
;
time_t
lastAttempt
;
}
ShoutData
;
static
ShoutData
*
newShoutData
()
{
...
...
@@ -81,6 +87,8 @@ static ShoutData * newShoutData() {
ret
->
tagToSend
=
0
;
ret
->
bitrate
=
-
1
;
ret
->
quality
=
-
1
.
0
;
ret
->
connAttempts
=
0
;
ret
->
lastAttempt
=
0
;
return
ret
;
}
...
...
@@ -370,12 +378,20 @@ static int initEncoder(ShoutData * sd) {
static
int
myShout_openShoutConn
(
AudioOutput
*
audioOutput
)
{
ShoutData
*
sd
=
(
ShoutData
*
)
audioOutput
->
data
;
time_t
t
=
time
(
NULL
);
if
(
shout_open
(
sd
->
shoutConn
)
!=
SHOUTERR_SUCCESS
)
{
ERROR
(
"problem opening connection to shout server: %s
\n
"
,
shout_get_error
(
sd
->
shoutConn
));
sd
->
connAttempts
++
;
if
(
t
-
sd
->
lastAttempt
<
CONN_ATTEMPT_INTERVAL
)
{
return
-
1
;
}
sd
->
lastAttempt
=
t
;
if
(
shout_open
(
sd
->
shoutConn
)
!=
SHOUTERR_SUCCESS
)
{
ERROR
(
"problem opening connection to shout server (attempt %i):"
" %s
\n
"
,
sd
->
connAttempts
,
shout_get_error
(
sd
->
shoutConn
));
return
-
1
;
}
...
...
@@ -404,8 +420,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput) {
}
}
/*if(sd->tag) freeMpdTag(sd->tag);
sd->tag = NULL;*/
sd
->
connAttempts
=
0
;
return
0
;
}
...
...
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