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
fef9747f
Commit
fef9747f
authored
Nov 10, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/shout: use MIME type instead of the encoder plugin name
This is more robust, for example it allows using the Shine encoder plugin instead of LAME.
parent
13816c1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
NEWS
NEWS
+1
-0
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+6
-3
No files found.
NEWS
View file @
fef9747f
...
@@ -10,6 +10,7 @@ ver 0.21 (not yet released)
...
@@ -10,6 +10,7 @@ ver 0.21 (not yet released)
- pcm: support audio/L24 (RFC 3190)
- pcm: support audio/L24 (RFC 3190)
* output
* output
- alsa: non-blocking mode
- alsa: non-blocking mode
- shout: support the Shine encoder plugin
- sndio: remove support for the broken RoarAudio sndio emulation
- sndio: remove support for the broken RoarAudio sndio emulation
* mixer
* mixer
- sndio: new mixer plugin
- sndio: new mixer plugin
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
fef9747f
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "encoder/EncoderList.hxx"
#include "encoder/EncoderList.hxx"
#include "util/RuntimeError.hxx"
#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include "util/StringAPI.hxx"
#include "Log.hxx"
#include "Log.hxx"
#include <shout/shout.h>
#include <shout/shout.h>
...
@@ -165,8 +166,10 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
...
@@ -165,8 +166,10 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
prepared_encoder
.
reset
(
encoder_init
(
*
encoder_plugin
,
block
));
prepared_encoder
.
reset
(
encoder_init
(
*
encoder_plugin
,
block
));
const
char
*
const
mime_type
=
prepared_encoder
->
GetMimeType
();
unsigned
shout_format
;
unsigned
shout_format
;
if
(
strcmp
(
encoding
,
"mp3"
)
==
0
||
strcmp
(
encoding
,
"lame"
)
==
0
)
if
(
StringIsEqual
(
mime_type
,
"audio/mpeg"
)
)
shout_format
=
SHOUT_FORMAT_MP3
;
shout_format
=
SHOUT_FORMAT_MP3
;
else
else
shout_format
=
SHOUT_FORMAT_OGG
;
shout_format
=
SHOUT_FORMAT_OGG
;
...
@@ -175,9 +178,9 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
...
@@ -175,9 +178,9 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
value
=
block
.
GetBlockValue
(
"protocol"
);
value
=
block
.
GetBlockValue
(
"protocol"
);
if
(
value
!=
nullptr
)
{
if
(
value
!=
nullptr
)
{
if
(
0
==
strcmp
(
value
,
"shoutcast"
)
&&
if
(
0
==
strcmp
(
value
,
"shoutcast"
)
&&
0
!=
strcmp
(
encoding
,
"mp3
"
))
!
StringIsEqual
(
mime_type
,
"audio/mpeg
"
))
throw
FormatRuntimeError
(
"you cannot stream
\"
%s
\"
to shoutcast, use mp3"
,
throw
FormatRuntimeError
(
"you cannot stream
\"
%s
\"
to shoutcast, use mp3"
,
encoding
);
mime_type
);
else
if
(
0
==
strcmp
(
value
,
"shoutcast"
))
else
if
(
0
==
strcmp
(
value
,
"shoutcast"
))
protocol
=
SHOUT_PROTOCOL_ICY
;
protocol
=
SHOUT_PROTOCOL_ICY
;
else
if
(
0
==
strcmp
(
value
,
"icecast1"
))
else
if
(
0
==
strcmp
(
value
,
"icecast1"
))
...
...
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