Skip to content

Commit

Permalink
MythMusic: Couple of tweaks to streaming radio playback
Browse files Browse the repository at this point in the history
* Allow both unix and window line-ending in the m3u playlist file.
* allow for URLs that have a query
(cherry picked from commit a39c41c)

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information
Paul Harrison authored and stuartm committed Jul 7, 2012
1 parent 92083c8 commit ebf4860
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/pls.cpp
Expand Up @@ -250,7 +250,7 @@ int PlayListFile::parsePLS(PlayListFile *pls, QTextStream *stream)
int PlayListFile::parseM3U(PlayListFile *pls, QTextStream *stream)
{
QString data = stream->readAll();
QStringList lines = data.split("\r\n");
QStringList lines = data.split(QRegExp("[\r\n]"));

QStringList::iterator it;
for (it = lines.begin(); it != lines.end(); ++it)
Expand Down
13 changes: 11 additions & 2 deletions mythplugins/mythmusic/mythmusic/shoutcast.cpp
Expand Up @@ -75,7 +75,12 @@ class ShoutCastRequest
"Host: %HOST%\r\n"
"User-Agent: MythMusic/%VERSION%\r\n"
"Accept: */*\r\n");
hdr.replace("%PATH%", url.path());

QString path = url.path();
if (url.hasQuery())
path += '?' + url.encodedQuery();

hdr.replace("%PATH%", path);
hdr.replace("%HOST%", url.host());
hdr.replace("%VERSION%", MYTH_BINARY_VERSION);

Expand Down Expand Up @@ -117,7 +122,11 @@ class IceCastRequest
"User-Agent: MythMusic/%VERSION%\r\n"
"Accept: */*\r\n");

hdr.replace("%PATH%", url.path());
QString path = url.path();
if (url.hasQuery())
path += '?' + url.encodedQuery();

hdr.replace("%PATH%", path);
hdr.replace("%HOST%", url.host());
hdr.replace("%VERSION%", MYTH_BINARY_VERSION);

Expand Down

0 comments on commit ebf4860

Please sign in to comment.