Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
17db41eb
Commit
17db41eb
authored
Nov 26, 2011
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added VCLT playlist support.
svn path=/icecast/trunk/icecast/; revision=18130
parent
759f55b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
7 deletions
+75
-7
ChangeLog
ChangeLog
+5
-0
admin/vclt.xsl
admin/vclt.xsl
+54
-0
src/fserve.c
src/fserve.c
+11
-6
web/status.xsl
web/status.xsl
+5
-1
No files found.
ChangeLog
View file @
17db41eb
2011-11-26 02:36 ph3-der-loewe
* trunk/icecast/src/fserve.c, trunk/icecast/admin/vclt.xsl,
trunk/icecast/web/status.xsl: Added VCLT playlist support.
2011-11-25 22:37 dm8tbr
* trunk/icecast/conf/icecast.xml.in:
...
...
admin/vclt.xsl
0 → 100644
View file @
17db41eb
<!--
VCLT xslt stylesheet for Icecast 2.3.2 and above
based on XSPF xslt stylesheet.
Copyright (C) 2007 Thomas B. Ruecker, tbr@ruecker-itk.de
Copyright (C) 2011 Philipp Schafft, lion@lion.leolix.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the
Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-->
<xsl:stylesheet
xmlns:xsl =
"http://www.w3.org/1999/XSL/Transform"
version =
"1.0"
>
<xsl:output
omit-xml-declaration=
"yes"
media-type=
"audio/x-vclt"
method=
"text"
indent=
"no"
encoding=
"UTF-8"
/>
<xsl:template
match =
"/icestats"
>
<xsl:for-each
select=
"source"
>
STREAMURL=
<xsl:value-of
select=
"listenurl"
/>
<xsl:if
test=
"artist"
><xsl:text>
</xsl:text>
ARTIST=
<xsl:value-of
select=
"artist"
/></xsl:if>
<xsl:if
test=
"title"
><xsl:text>
</xsl:text>
TITLE=
<xsl:value-of
select=
"title"
/></xsl:if>
<xsl:if
test=
"server_name"
><xsl:text>
</xsl:text>
SERVER_NAME=
<xsl:value-of
select=
"server_name"
/></xsl:if>
<xsl:if
test=
"server_description"
><xsl:text>
</xsl:text>
DESCRIPTION=
<xsl:value-of
select=
"server_description"
/></xsl:if>
SIGNALINFO=
<xsl:choose>
<xsl:when
test=
"server_type = 'application/ogg'"
>
<xsl:choose>
<xsl:when
test=
"subtype = 'Vorbis'"
>
codec:ogg_vorbis
</xsl:when>
<!-- More codecs should be added here, however I don't know how to find out about the codec.
At the moment we just guess that application/ogg is a Ogg bitstream with some undefined
codec. Everything else is undefined.
-->
<xsl:otherwise>
codec:ogg_general
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose><xsl:text>
</xsl:text>
<xsl:if
test=
"genre"
>
GENRE=
<xsl:value-of
select=
"genre"
/></xsl:if>
==
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
src/fserve.c
View file @
17db41eb
...
...
@@ -8,6 +8,7 @@
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
* Copyright 2011, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>.
*/
#ifdef HAVE_CONFIG_H
...
...
@@ -405,7 +406,8 @@ int fserve_client_create (client_t *httpclient, const char *path)
int
ret
=
0
;
char
*
fullpath
;
int
m3u_requested
=
0
,
m3u_file_available
=
1
;
int
xspf_requested
=
0
,
xspf_file_available
=
1
;
const
char
*
xslt_playlist_requested
=
NULL
;
int
xslt_playlist_file_available
=
1
;
ice_config_t
*
config
;
FILE
*
file
;
...
...
@@ -416,13 +418,16 @@ int fserve_client_create (client_t *httpclient, const char *path)
m3u_requested
=
1
;
if
(
strcmp
(
util_get_extension
(
fullpath
),
"xspf"
)
==
0
)
xspf_requested
=
1
;
xslt_playlist_requested
=
"xspf.xsl"
;
if
(
strcmp
(
util_get_extension
(
fullpath
),
"vclt"
)
==
0
)
xslt_playlist_requested
=
"vclt.xsl"
;
/* check for the actual file */
if
(
stat
(
fullpath
,
&
file_buf
)
!=
0
)
{
/* the m3u can be generated, but send an m3u file if available */
if
(
m3u_requested
==
0
&&
xs
pf
_requested
==
0
)
if
(
m3u_requested
==
0
&&
xs
lt_playlist
_requested
==
NULL
)
{
WARN2
(
"req for file
\"
%s
\"
%s"
,
fullpath
,
strerror
(
errno
));
client_send_404
(
httpclient
,
"The file you requested could not be found"
);
...
...
@@ -430,7 +435,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
return
-
1
;
}
m3u_file_available
=
0
;
xs
pf
_file_available
=
0
;
xs
lt_playlist
_file_available
=
0
;
}
httpclient
->
refbuf
->
len
=
PER_CLIENT_REFBUF_SIZE
;
...
...
@@ -477,7 +482,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
free
(
fullpath
);
return
0
;
}
if
(
xs
pf
_requested
&&
xs
pf
_file_available
==
0
)
if
(
xs
lt_playlist
_requested
&&
xs
lt_playlist
_file_available
==
0
)
{
xmlDocPtr
doc
;
char
*
reference
=
strdup
(
path
);
...
...
@@ -486,7 +491,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
*
eol
=
'\0'
;
doc
=
stats_get_xml
(
0
,
reference
);
free
(
reference
);
admin_send_response
(
doc
,
httpclient
,
TRANSFORMED
,
"
xs
pf.xsl"
);
admin_send_response
(
doc
,
httpclient
,
TRANSFORMED
,
xs
lt_playlist_requested
);
xmlFreeDoc
(
doc
);
return
0
;
}
...
...
web/status.xsl
View file @
17db41eb
...
...
@@ -49,7 +49,11 @@
<td
align=
"right"
><a
class=
"auth"
href=
"/auth.xsl"
>
Login
</a></td>
</xsl:when>
<xsl:otherwise>
<td
align=
"right"
>
<a
href=
"{@mount}.m3u"
>
M3U
</a>
<a
href=
"{@mount}.xspf"
>
XSPF
</a></td>
<td
align=
"right"
>
<a
href=
"{@mount}.m3u"
>
M3U
</a>
<a
href=
"{@mount}.xspf"
>
XSPF
</a>
<a
href=
"{@mount}.vclt"
>
VCLT
</a>
</td>
</xsl:otherwise>
</xsl:choose>
</tr></table>
...
...
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