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
2139d8bb
Commit
2139d8bb
authored
Oct 12, 2008
by
Aaron McEwan
Committed by
Max Kellermann
Oct 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shout: make the protocol configurable
Added configuration parameter "protocol" which lets the user choose from 3 shout protocols. This adds support for real shoutcast servers.
parent
ff69f122
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
mpd.conf.5
doc/mpd.conf.5
+5
-1
mpdconf.example
doc/mpdconf.example
+1
-0
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+25
-2
No files found.
doc/mpd.conf.5
View file @
2139d8bb
...
...
@@ -382,8 +382,12 @@ for encoding.
.TP
.B encoding <encoding>
This specifies which output encoding to use. Should be either "ogg"
or "mp3"
.
The default is "ogg".
or "mp3"
, "mp3" is needed for shoutcast streaming.
The default is "ogg".
.TP
.B protocol <protocol>
This specifies the protocol that wil be used to connect to the
icecast/shoutcast server. The options are "shoutcast", "icecast1" and
"icecast2". The default is "icecast2".
.B user <username>
This specifies the username to use when logging in to the icecast server. The
default is "source".
...
...
doc/mpdconf.example
View file @
2139d8bb
...
...
@@ -121,6 +121,7 @@ error_file "~/.mpd/mpd.error"
# quality "5.0"
# bitrate "128"
# format "44100:16:1"
# protocol "icecast2"
# user "source" # optional
# description "My Stream Description" # optional
# genre "jazz" # optional
...
...
src/audioOutputs/audioOutput_shout.c
View file @
2139d8bb
...
...
@@ -104,6 +104,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
char
*
mount
;
char
*
passwd
;
const
char
*
encoding
;
unsigned
protocol
;
const
char
*
user
;
char
*
name
;
BlockParam
*
block_param
;
...
...
@@ -208,6 +209,29 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
FATAL
(
"couldn't find shout encoder plugin for
\"
%s
\"
"
"at line %i
\n
"
,
encoding
,
block_param
->
line
);
check_block_param
(
"protocol"
);
block_param
=
getBlockParam
(
param
,
"protocol"
);
if
(
block_param
)
{
if
(
0
==
strcmp
(
block_param
->
value
,
"shoutcast"
)
&&
0
!=
strcmp
(
encoding
,
"mp3"
))
FATAL
(
"you cannot stream
\"
%s
\"
to shoutcast, use mp3
\n
"
,
encoding
);
else
if
(
0
==
strcmp
(
block_param
->
value
,
"shoutcast"
))
protocol
=
SHOUT_PROTOCOL_ICY
;
else
if
(
0
==
strcmp
(
block_param
->
value
,
"icecast1"
))
protocol
=
SHOUT_PROTOCOL_XAUDIOCAST
;
else
if
(
0
==
strcmp
(
block_param
->
value
,
"icecast2"
))
protocol
=
SHOUT_PROTOCOL_HTTP
;
else
FATAL
(
"shout protocol
\"
%s
\"
is not
\"
shoutcast
\"
or "
"
\"
icecast1
\"
or "
"
\"
icecast2
\"
, line %i
\n
"
,
block_param
->
value
,
block_param
->
line
);
}
else
{
protocol
=
SHOUT_PROTOCOL_HTTP
;
}
if
(
shout_set_host
(
sd
->
shout_conn
,
host
)
!=
SHOUTERR_SUCCESS
||
shout_set_port
(
sd
->
shout_conn
,
port
)
!=
SHOUTERR_SUCCESS
||
shout_set_password
(
sd
->
shout_conn
,
passwd
)
!=
SHOUTERR_SUCCESS
||
...
...
@@ -218,8 +242,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
shout_set_nonblocking
(
sd
->
shout_conn
,
1
)
!=
SHOUTERR_SUCCESS
||
shout_set_format
(
sd
->
shout_conn
,
sd
->
encoder
->
shout_format
)
!=
SHOUTERR_SUCCESS
||
shout_set_protocol
(
sd
->
shout_conn
,
SHOUT_PROTOCOL_HTTP
)
!=
SHOUTERR_SUCCESS
||
shout_set_protocol
(
sd
->
shout_conn
,
protocol
)
!=
SHOUTERR_SUCCESS
||
shout_set_agent
(
sd
->
shout_conn
,
"MPD"
)
!=
SHOUTERR_SUCCESS
)
{
FATAL
(
"error configuring shout defined at line %i: %s
\n
"
,
param
->
line
,
shout_get_error
(
sd
->
shout_conn
));
...
...
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