mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Cleanup: Codestyle
This commit is contained in:
parent
4dcea865c4
commit
109adf8368
@ -34,9 +34,9 @@
|
|||||||
static void flac_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec)
|
static void flac_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec)
|
||||||
{
|
{
|
||||||
ICECAST_LOG_DEBUG("freeing FLAC codec");
|
ICECAST_LOG_DEBUG("freeing FLAC codec");
|
||||||
stats_event (ogg_info->mount, "FLAC_version", NULL);
|
stats_event(ogg_info->mount, "FLAC_version", NULL);
|
||||||
ogg_stream_clear (&codec->os);
|
ogg_stream_clear(&codec->os);
|
||||||
free (codec);
|
free(codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -45,36 +45,40 @@ static refbuf_t *process_flac_page (ogg_state_t *ogg_info, ogg_codec_t *codec, o
|
|||||||
{
|
{
|
||||||
refbuf_t * refbuf;
|
refbuf_t * refbuf;
|
||||||
|
|
||||||
if (codec->headers)
|
if (codec->headers) {
|
||||||
{
|
|
||||||
ogg_packet packet;
|
ogg_packet packet;
|
||||||
if (ogg_stream_pagein (&codec->os, page) < 0)
|
|
||||||
{
|
if (ogg_stream_pagein(&codec->os, page) < 0) {
|
||||||
ogg_info->error = 1;
|
ogg_info->error = 1;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
while (ogg_stream_packetout (&codec->os, &packet))
|
|
||||||
{
|
while (ogg_stream_packetout(&codec->os, &packet)) {
|
||||||
int type = packet.packet[0];
|
int type = packet.packet[0];
|
||||||
if (type == 0xFF)
|
|
||||||
{
|
if (type == 0xFF) {
|
||||||
codec->headers = 0;
|
codec->headers = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type >= 1 && type <= 0x7E)
|
if (type >= 1 && type <= 0x7E)
|
||||||
continue;
|
continue;
|
||||||
if (type >= 0x81 && type <= 0xFE)
|
if (type >= 0x81 && type <= 0xFE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ogg_info->error = 1;
|
ogg_info->error = 1;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (codec->headers)
|
|
||||||
{
|
if (codec->headers) {
|
||||||
format_ogg_attach_header (ogg_info, page);
|
format_ogg_attach_header(ogg_info, page);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refbuf = make_refbuf_with_page (page);
|
|
||||||
|
refbuf = make_refbuf_with_page(page);
|
||||||
|
|
||||||
return refbuf;
|
return refbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,13 +88,13 @@ static refbuf_t *process_flac_page (ogg_state_t *ogg_info, ogg_codec_t *codec, o
|
|||||||
ogg_codec_t *initial_flac_page (format_plugin_t *plugin, ogg_page *page)
|
ogg_codec_t *initial_flac_page (format_plugin_t *plugin, ogg_page *page)
|
||||||
{
|
{
|
||||||
ogg_state_t *ogg_info = plugin->_state;
|
ogg_state_t *ogg_info = plugin->_state;
|
||||||
ogg_codec_t *codec = calloc (1, sizeof (ogg_codec_t));
|
ogg_codec_t *codec = calloc(1, sizeof(ogg_codec_t));
|
||||||
ogg_packet packet;
|
ogg_packet packet;
|
||||||
|
|
||||||
ogg_stream_init (&codec->os, ogg_page_serialno (page));
|
ogg_stream_init(&codec->os, ogg_page_serialno(page));
|
||||||
ogg_stream_pagein (&codec->os, page);
|
ogg_stream_pagein(&codec->os, page);
|
||||||
|
|
||||||
ogg_stream_packetout (&codec->os, &packet);
|
ogg_stream_packetout(&codec->os, &packet);
|
||||||
|
|
||||||
ICECAST_LOG_DEBUG("checking for FLAC codec");
|
ICECAST_LOG_DEBUG("checking for FLAC codec");
|
||||||
do
|
do
|
||||||
@ -108,7 +112,7 @@ ogg_codec_t *initial_flac_page (format_plugin_t *plugin, ogg_page *page)
|
|||||||
ICECAST_LOG_INFO("seen initial FLAC header");
|
ICECAST_LOG_INFO("seen initial FLAC header");
|
||||||
|
|
||||||
parse += 4;
|
parse += 4;
|
||||||
stats_event_args (ogg_info->mount, "FLAC_version", "%d.%d", parse[0], parse[1]);
|
stats_event_args(ogg_info->mount, "FLAC_version", "%d.%d", parse[0], parse[1]);
|
||||||
codec->process_page = process_flac_page;
|
codec->process_page = process_flac_page;
|
||||||
codec->codec_free = flac_codec_free;
|
codec->codec_free = flac_codec_free;
|
||||||
codec->headers = 1;
|
codec->headers = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user