Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
d077dc4b
Commit
d077dc4b
authored
Dec 10, 2004
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add subtype to yp add phase, this is to identify the codecs in use
svn path=/icecast/trunk/icecast/; revision=8360
parent
4066a89c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
6 deletions
+48
-6
src/format_ogg.c
src/format_ogg.c
+19
-0
src/format_ogg.h
src/format_ogg.h
+1
-0
src/format_theora.c
src/format_theora.c
+2
-0
src/format_vorbis.c
src/format_vorbis.c
+1
-0
src/yp.c
src/yp.c
+24
-6
src/yp.h
src/yp.h
+1
-0
No files found.
src/format_ogg.c
View file @
d077dc4b
...
...
@@ -242,6 +242,8 @@ static void update_comments (source_t *source)
char
*
artist
=
ogg_info
->
artist
;
char
*
metadata
=
NULL
;
unsigned
int
len
=
0
;
ogg_codec_t
*
codec
;
char
codec_names
[
100
]
=
""
;
if
(
ogg_info
->
artist
)
{
...
...
@@ -274,6 +276,23 @@ static void update_comments (source_t *source)
}
stats_event
(
source
->
mount
,
"artist"
,
artist
);
stats_event
(
source
->
mount
,
"title"
,
title
);
codec
=
ogg_info
->
codecs
;
while
(
codec
)
{
if
(
codec
->
name
)
{
int
len
=
strlen
(
codec_names
);
int
remaining
=
sizeof
(
codec_names
)
-
len
;
char
*
where
=
codec_names
+
len
;
char
*
separator
=
" "
;
if
(
len
==
0
)
separator
=
""
;
snprintf
(
where
,
remaining
,
"%s%s"
,
separator
,
codec
->
name
);
}
codec
=
codec
->
next
;
}
stats_event
(
source
->
mount
,
"subtype"
,
codec_names
);
yp_touch
(
source
->
mount
);
}
...
...
src/format_ogg.h
View file @
d077dc4b
...
...
@@ -49,6 +49,7 @@ typedef struct ogg_codec_tag
struct
ogg_codec_tag
*
next
;
ogg_stream_state
os
;
unsigned
headers
;
const
char
*
name
;
void
*
specific
;
refbuf_t
*
possible_start
;
refbuf_t
*
page
;
...
...
src/format_theora.c
View file @
d077dc4b
...
...
@@ -177,6 +177,8 @@ ogg_codec_t *initial_theora_page (format_plugin_t *plugin, ogg_page *page)
codec
->
process_page
=
process_theora_page
;
codec
->
codec_free
=
theora_codec_free
;
codec
->
headers
=
1
;
codec
->
name
=
"Theora"
;
format_ogg_attach_header
(
ogg_info
,
page
);
ogg_info
->
codec_sync
=
codec
;
return
codec
;
...
...
src/format_vorbis.c
View file @
d077dc4b
...
...
@@ -357,6 +357,7 @@ ogg_codec_t *initial_vorbis_page (format_plugin_t *plugin, ogg_page *page)
codec
->
specific
=
vorbis
;
codec
->
codec_free
=
vorbis_codec_free
;
codec
->
headers
=
1
;
codec
->
name
=
"Vorbis"
;
free_ogg_packet
(
vorbis
->
header
[
0
]);
free_ogg_packet
(
vorbis
->
header
[
1
]);
...
...
src/yp.c
View file @
d077dc4b
...
...
@@ -70,6 +70,7 @@ typedef struct ypdata_tag
char
*
audio_info
;
char
*
server_type
;
char
*
current_song
;
char
*
subtype
;
struct
yp_server
*
server
;
time_t
next_update
;
...
...
@@ -330,11 +331,21 @@ static unsigned do_yp_remove (ypdata_t *yp, char *s, unsigned len)
static
unsigned
do_yp_add
(
ypdata_t
*
yp
,
char
*
s
,
unsigned
len
)
{
int
ret
=
snprintf
(
s
,
len
,
"action=add&sn=%s&genre=%s&cpswd=%s&desc="
"%s&url=%s&listenurl=%s&type=%s&b=%s&%s
\r\n
"
,
int
ret
;
char
*
value
;
value
=
stats_get_value
(
yp
->
mount
,
"subtype"
);
if
(
value
)
{
add_yp_info
(
yp
,
"subtype"
,
value
,
YP_SUBTYPE
);
free
(
value
);
}
ret
=
snprintf
(
s
,
len
,
"action=add&sn=%s&genre=%s&cpswd=%s&desc="
"%s&url=%s&listenurl=%s&type=%s&stype=%s&b=%s&%s
\r\n
"
,
yp
->
server_name
,
yp
->
server_genre
,
yp
->
cluster_password
,
yp
->
server_desc
,
yp
->
url
,
yp
->
listen_url
,
yp
->
server_type
,
yp
->
bitrate
,
yp
->
audio_info
);
yp
->
server_type
,
yp
->
subtype
,
yp
->
bitrate
,
yp
->
audio_info
);
if
(
ret
>=
(
signed
)
len
)
return
ret
+
1
;
if
(
send_to_yp
(
"add"
,
yp
,
s
)
==
0
)
...
...
@@ -483,6 +494,7 @@ static ypdata_t *create_yp_entry (source_t *source)
yp
->
url
=
strdup
(
""
);
yp
->
current_song
=
strdup
(
""
);
yp
->
audio_info
=
strdup
(
""
);
yp
->
subtype
=
strdup
(
""
);
yp
->
process
=
do_yp_add
;
url
=
malloc
(
len
);
...
...
@@ -747,9 +759,7 @@ static void yp_destroy_ypdata(ypdata_t *ypdata)
if
(
ypdata
->
audio_info
)
{
free
(
ypdata
->
audio_info
);
}
if
(
ypdata
->
cluster_password
)
{
free
(
ypdata
->
cluster_password
);
}
free
(
ypdata
->
subtype
);
free
(
ypdata
->
error_msg
);
free
(
ypdata
);
}
...
...
@@ -847,6 +857,14 @@ static void add_yp_info (ypdata_t *yp, char *stat_name, void *info, int type)
yp
->
cluster_password
=
escaped
;
}
break
;
case
YP_SUBTYPE
:
escaped
=
util_url_escape
(
info
);
if
(
escaped
)
{
free
(
yp
->
subtype
);
yp
->
subtype
=
escaped
;
}
break
;
}
}
...
...
src/yp.h
View file @
d077dc4b
...
...
@@ -23,6 +23,7 @@
#define YP_SERVER_TYPE 7
#define YP_CURRENT_SONG 8
#define YP_CLUSTER_PASSWORD 9
#define YP_SUBTYPE 10
struct
source_tag
;
...
...
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