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
32f52c62
Commit
32f52c62
authored
Feb 25, 2004
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send mp3 url metadata into a format specific routine
svn path=/trunk/icecast/; revision=5864
parent
f6f31cdc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
src/format.h
src/format.h
+1
-1
src/format_mp3.c
src/format_mp3.c
+15
-0
src/format_vorbis.c
src/format_vorbis.c
+1
-0
No files found.
src/format.h
View file @
32f52c62
...
@@ -54,7 +54,7 @@ typedef struct _format_plugin_tag
...
@@ -54,7 +54,7 @@ typedef struct _format_plugin_tag
struct
source_tag
*
source
,
client_t
*
client
);
struct
source_tag
*
source
,
client_t
*
client
);
void
(
*
client_send_headers
)(
struct
_format_plugin_tag
*
format
,
void
(
*
client_send_headers
)(
struct
_format_plugin_tag
*
format
,
struct
source_tag
*
source
,
client_t
*
client
);
struct
source_tag
*
source
,
client_t
*
client
);
void
(
*
set_tag
)(
struct
_format_plugin_tag
*
plugin
,
char
*
tag
,
char
*
value
);
void
(
*
free_plugin
)(
struct
_format_plugin_tag
*
self
);
void
(
*
free_plugin
)(
struct
_format_plugin_tag
*
self
);
/* for internal state management */
/* for internal state management */
...
...
src/format_mp3.c
View file @
32f52c62
...
@@ -63,6 +63,7 @@ static int format_mp3_write_buf_to_client(format_plugin_t *self,
...
@@ -63,6 +63,7 @@ static int format_mp3_write_buf_to_client(format_plugin_t *self,
client_t
*
client
,
unsigned
char
*
buf
,
int
len
);
client_t
*
client
,
unsigned
char
*
buf
,
int
len
);
static
void
format_mp3_send_headers
(
format_plugin_t
*
self
,
static
void
format_mp3_send_headers
(
format_plugin_t
*
self
,
source_t
*
source
,
client_t
*
client
);
source_t
*
source
,
client_t
*
client
);
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
);
typedef
struct
{
typedef
struct
{
int
use_metadata
;
int
use_metadata
;
...
@@ -88,6 +89,7 @@ format_plugin_t *format_mp3_get_plugin(http_parser_t *parser)
...
@@ -88,6 +89,7 @@ format_plugin_t *format_mp3_get_plugin(http_parser_t *parser)
plugin
->
create_client_data
=
format_mp3_create_client_data
;
plugin
->
create_client_data
=
format_mp3_create_client_data
;
plugin
->
client_send_headers
=
format_mp3_send_headers
;
plugin
->
client_send_headers
=
format_mp3_send_headers
;
plugin
->
free_plugin
=
format_mp3_free_plugin
;
plugin
->
free_plugin
=
format_mp3_free_plugin
;
plugin
->
set_tag
=
mp3_set_tag
;
plugin
->
format_description
=
"MP3 audio"
;
plugin
->
format_description
=
"MP3 audio"
;
plugin
->
_state
=
state
;
plugin
->
_state
=
state
;
...
@@ -103,6 +105,19 @@ format_plugin_t *format_mp3_get_plugin(http_parser_t *parser)
...
@@ -103,6 +105,19 @@ format_plugin_t *format_mp3_get_plugin(http_parser_t *parser)
return
plugin
;
return
plugin
;
}
}
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
)
{
mp3_state
*
state
=
plugin
->
_state
;
thread_mutex_lock
(
&
(
state
->
lock
));
free
(
state
->
metadata
);
state
->
metadata
=
strdup
(
value
);
state
->
metadata_age
++
;
thread_mutex_unlock
(
&
(
state
->
lock
));
}
static
int
send_metadata
(
client_t
*
client
,
mp3_client_data
*
client_state
,
static
int
send_metadata
(
client_t
*
client
,
mp3_client_data
*
client_state
,
mp3_state
*
source_state
)
mp3_state
*
source_state
)
{
{
...
...
src/format_vorbis.c
View file @
32f52c62
...
@@ -77,6 +77,7 @@ format_plugin_t *format_vorbis_get_plugin(void)
...
@@ -77,6 +77,7 @@ format_plugin_t *format_vorbis_get_plugin(void)
plugin
->
create_client_data
=
format_vorbis_create_client_data
;
plugin
->
create_client_data
=
format_vorbis_create_client_data
;
plugin
->
client_send_headers
=
format_vorbis_send_headers
;
plugin
->
client_send_headers
=
format_vorbis_send_headers
;
plugin
->
free_plugin
=
format_vorbis_free_plugin
;
plugin
->
free_plugin
=
format_vorbis_free_plugin
;
plugin
->
set_tag
=
NULL
;
plugin
->
format_description
=
"Ogg Vorbis"
;
plugin
->
format_description
=
"Ogg Vorbis"
;
state
=
(
vstate_t
*
)
calloc
(
1
,
sizeof
(
vstate_t
));
state
=
(
vstate_t
*
)
calloc
(
1
,
sizeof
(
vstate_t
));
...
...
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