Commit 998a8916 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Cleanup: removed useless white spaces and blank lines at end of file

parent fb65727d
......@@ -59,7 +59,7 @@ void downmix_buffer_float(downmix_state *s, float **buf, int samples)
for(i=0; i < samples; i++) {
s->buffer[i] = (buf[0][i] + buf[1][i])*0.5;
}
}
......@@ -111,7 +111,7 @@ resample_state *resample_initialise(int channels, int infreq, int outfreq)
failed = 0;
}
while (0); /* not a loop */
if (failed)
{
LOG_ERROR0("Couldn't initialise resampler due to memory allocation failure");
......@@ -224,9 +224,3 @@ void resample_finish(resample_state *s)
s->buffill = ret;
}
......@@ -46,4 +46,3 @@ void resample_buffer_float(resample_state *s, float **buf, int buflen);
void resample_finish(resample_state *s);
#endif
......@@ -120,14 +120,14 @@ static int _using_default_instance = 1;
static void _free_instances(instance_t *instance)
{
instance_t *next;
next = NULL;
do
{
config_free_instance(instance);
next = instance->next;
free(instance);
instance = next;
} while (next != NULL);
}
......@@ -394,7 +394,7 @@ static void _parse_root(config_t *config, xmlDocPtr doc, xmlNodePtr node)
{
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "background") == 0)
SET_INT(config->background);
else if (strcmp(node->name, "logpath") == 0)
......@@ -431,7 +431,7 @@ static void _set_defaults(config_t *c)
c->stream_url = NULL;
c->playlist_module = xmlStrdup(DEFAULT_PLAYLIST_MODULE);
c->module_params = NULL;
instance = (instance_t *)malloc(sizeof(instance_t));
......@@ -449,7 +449,7 @@ static void _free_params(module_param_t *param)
if (param->value) free(param->value);
next = param->next;
free(param);
param = next;
} while (next != NULL);
}
......@@ -553,12 +553,6 @@ void config_dump(void)
i = i->next;
}
fprintf(stderr, "\n");
}
......@@ -99,9 +99,9 @@ typedef struct _config_tag
char *stream_genre;
char *stream_description;
char *stream_url;
/* <playlist> */
char *playlist_module;
module_param_t *module_params;
......@@ -132,8 +132,3 @@ void config_dump(void);
void config_free_instance(instance_t *instance);
#endif /* __CONFIG_H__ */
......@@ -43,4 +43,3 @@ void encode_close();
#endif
......@@ -23,4 +23,3 @@ enum event_type {
};
#endif /* __EVENT_H__ */
......@@ -153,5 +153,3 @@ int main(int argc, char **argv)
return 0;
}
......@@ -289,5 +289,3 @@ fail:
close_module(mod); /* safe, this checks for valid contents */
return NULL;
}
......@@ -269,5 +269,3 @@ fail:
close_module(mod); /* safe, this checks for valid contents */
return NULL;
}
......@@ -254,7 +254,7 @@ input_module_t *playlist_open_module(module_param_t *params)
}
current_module++;
}
if(!init)
{
LOG_ERROR1("Unknown playlist type \"%s\"", current->value);
......@@ -290,5 +290,3 @@ fail:
return NULL;
}
......@@ -26,7 +26,7 @@ typedef struct _playlist_state_tag
int nexttrack;
int allow_repeat;
ogg_sync_state oy;
char *(*get_filename)(void *data); /* returns the next desired filename */
void (*free_filename)(void *data, char *fn); /* Called when im_playlist is
done with this filename */
......
......@@ -354,5 +354,3 @@ fail:
close_module(mod); /* safe, this checks for valid contents */
return NULL;
}
......@@ -189,4 +189,3 @@ input_module_t *stdin_open_module(module_param_t *params)
return mod;
}
......@@ -263,4 +263,3 @@ fail:
close_module(mod); /* safe, this checks for valid contents */
return NULL;
}
......@@ -34,4 +34,3 @@ typedef struct
input_module_t *sun_open_module(module_param_t *params);
#endif /* __IM_SUN_H__ */
......@@ -407,7 +407,7 @@ void input_loop(void)
free(chunk);
continue;
}
/* If this is the first time through, set initial time. This should
* be done before the call to inmod->getdata() below, in order to
* properly keep time if this input module blocks.
......@@ -467,16 +467,16 @@ void input_loop(void)
instance = instance->next;
continue;
}
queued = malloc(sizeof(queue_item));
queued->buf = chunk;
current = instance->queue;
inc_count++;
thread_mutex_lock(&current->lock);
if(current->head == NULL)
{
current->head = current->tail = queued;
......@@ -547,5 +547,3 @@ void input_loop(void)
return;
}
......@@ -44,5 +44,3 @@ int input_calculate_pcm_sleep(unsigned bytes, unsigned bytes_per_sec);
#endif /* __INPUT_H__ */
......@@ -42,4 +42,3 @@ typedef struct _input_module_tag {
} input_module_t;
#endif /* __INPUTMODULE_H__ */
......@@ -50,4 +50,3 @@
#endif /* __LOGGING_H */
......@@ -64,7 +64,7 @@ void *metadata_thread_stdin(void *arg)
FD_SET (0, &fds);
t.tv_sec = 0;
t.tv_usec = 150;
switch (select (1, &fds, NULL, NULL, &t))
{
case 1:
......@@ -178,5 +178,3 @@ void *metadata_thread_signal(void *arg)
}
}
......@@ -18,4 +18,3 @@ void *metadata_thread_stdin(void *arg);
void *metadata_thread_signal(void *arg);
#endif /* __METADATA_H__ */
......@@ -112,4 +112,3 @@ void *ices_instance_output(void *arg)
return NULL;
}
......@@ -283,4 +283,3 @@ int playlist_basic_initialise(module_param_t *params, playlist_state_t *pl)
return 0;
}
......@@ -43,4 +43,3 @@ int playlist_script_initialise(module_param_t *params, playlist_state_t *pl);
#endif /* __PLAYLIST_BASIC_H__ */
......@@ -151,4 +151,3 @@ int playlist_script_initialise(module_param_t *params, playlist_state_t *pl)
return 0;
}
......@@ -56,7 +56,7 @@ void acquire_buffer(ref_buffer *buf)
#endif
buf->count++;
thread_mutex_unlock(&ices_config->refcount_lock);
}
......@@ -75,7 +75,7 @@ void release_buffer(ref_buffer *buf)
#endif
buf->count--;
if(!buf->count)
{
free(buf->buf);
......@@ -106,7 +106,7 @@ int process_chain(instance_t *instance, process_chain_element *chain,
in->type, chain->input_type);
return -2;
}
ret = chain->process(instance, chain->priv_data, in, out);
if(ret <= 0) {
......@@ -149,7 +149,3 @@ void create_event(process_chain_element *chain, event_type event,
if(!broadcast)
LOG_INFO1("Non-broadcast event %d unhandled", event);
}
......@@ -68,14 +68,14 @@ typedef struct _process_chain_element {
char *name;
open_func open;
struct _module_param_t *params;
process_func process;
event_func event_handler;
void *priv_data;
media_type input_type;
media_type output_type;
struct _process_chain_element *next;
} process_chain_element;
......@@ -105,5 +105,3 @@ void create_event(process_chain_element *chain, event_type event, void *param,
int broadcast);
#endif /* __PROCESS_H__ */
......@@ -76,7 +76,7 @@ int reencode_page(reencode_state *s, ref_buffer *buf,
ogg_packet op;
int retbuflen=0, old;
unsigned char *retbuf=NULL;
og.header_len = buf->aux_data;
og.body_len = buf->len - buf->aux_data;
......@@ -152,7 +152,7 @@ int reencode_page(reencode_state *s, ref_buffer *buf,
{
vorbis_block_init(&s->vd, &s->vb);
vorbis_synthesis_init(&s->vd, &s->vi);
s->encoder = encode_initialise(s->out_channels,
s->out_samplerate, s->managed,
s->out_min_br, s->out_nom_br, s->out_max_br,
......@@ -248,5 +248,3 @@ int reencode_page(reencode_state *s, ref_buffer *buf,
return 0;
}
}
......@@ -59,4 +59,3 @@ void reencode_clear(reencode_state *s);
#endif /* __REENCODE_H */
......@@ -62,4 +62,3 @@ static module registered_modules[] = {
};
#endif /* __REGISTRY_H__ */
......@@ -48,7 +48,7 @@ static void filt_sinc(float *dest, int N, int step, double fc, double gain, int
float *endpoint = dest + N,
*base = dest,
*origdest = dest;
assert(width <= N);
if ((N & 1) == 0)
......@@ -168,7 +168,7 @@ int resampler_init(resampler_state *state, int channels, int outfreq, int infreq
taps = va_arg(argp, int);
assert(taps > 2 && taps < 1000);
break;
case RES_BETA:
beta = va_arg(argp, double);
assert(beta > 2.0);
......@@ -257,7 +257,7 @@ static int push(resampler_state const * const state, SAMPLE *pool, int * const p
assert(source);
assert(state->poolfill != -1);
lencheck = resampler_push_check(state, srclen);
/* fill the pool before diving in */
......@@ -359,7 +359,7 @@ int resampler_push(resampler_state *state, SAMPLE **dstlist, SAMPLE const **srcl
int resampler_push_interleaved(resampler_state *state, SAMPLE *dest, SAMPLE const *source, size_t srclen)
{
int result = -1, poolfill = -1, offset = -1, i;
assert(state);
assert(dest);
assert(source);
......@@ -396,7 +396,7 @@ int resampler_drain(resampler_state *state, SAMPLE **dstlist)
offset = state->offset;
result = push(state, state->pool + i * state->taps, &poolfill, &offset, dstlist[i], 1, tail, 1, state->taps / 2 - 1);
}
free(tail);
state->poolfill = -1;
......@@ -423,7 +423,7 @@ int resampler_drain_interleaved(resampler_state *state, SAMPLE *dest)
offset = state->offset;
result = push(state, state->pool + i * state->taps, &poolfill, &offset, dest + i, state->channels, tail, 1, state->taps / 2 - 1);
}
free(tail);
state->poolfill = -1;
......@@ -442,4 +442,3 @@ void resampler_clear(resampler_state *state)
free(state->pool);
memset(state, 0, sizeof(*state));
}
......@@ -104,4 +104,3 @@ void resampler_clear(resampler_state *state);
*/
#endif
......@@ -37,7 +37,7 @@ void *savefile_stream(void *arg)
FILE *file;
int ret;
char *filename = stream->savefilename;
/* FIXME: Check for file existence, and append some unique string
* if it already exists.
*/
......@@ -82,8 +82,3 @@ void *savefile_stream(void *arg)
stream->died = 1;
return NULL;
}
......@@ -25,5 +25,3 @@ void signals_setup(void);
#endif
#endif
......@@ -60,7 +60,7 @@ void *ices_instance_stream(void *arg)
char *stream_name = NULL, *stream_genre = NULL, *stream_description = NULL;
char *stream_url = NULL, *user = NULL;
char audio_info[11];
vorbis_comment_init(&sdsc->vc);
sdsc->shout = shout_new();
......@@ -331,7 +331,7 @@ retry:
/* Also, flush the current queue */
input_flush_queue(stream->queue, 1);
thread_mutex_unlock(&ices_config->flush_lock);
shout_close(sdsc->shout);
if (i >= stream->reconnect_attempts)
......@@ -398,7 +398,7 @@ retry:
LOG_ERROR3("Failed initial connect to %s:%d (%s)",
shout_get_host(sdsc->shout), shout_get_port(sdsc->shout), shout_get_error(sdsc->shout));
}
shout_close(sdsc->shout);
if(stream->savefile != NULL)
......@@ -414,4 +414,3 @@ retry:
stream->died = 1;
return NULL;
}
......@@ -43,4 +43,3 @@ void *ices_instance_stream(void *arg);
void *savefile_stream(void *arg);
#endif
......@@ -214,7 +214,7 @@ int stream_get_page(stream_rewriter *s, ogg_page *page)
vorbis_info_init(&s->vi);
vorbis_comment_init(&s->vc);
}
if(s->in_header)
{
if(vorbis_synthesis_headerin(&s->vi, &s->vc, &packet) < 0)
......@@ -248,4 +248,3 @@ int stream_get_page(stream_rewriter *s, ogg_page *page)
* FIXME: cope with chained streams properly. */
return 0;
}
......@@ -210,10 +210,9 @@ int process_and_send_buffer(stream_description *sdsc, ref_buffer *buffer)
if ((ret = stream_send_data(sdsc, og.body, og.body_len)) == 0)
return 0;
}
return ret;
}
else
return stream_send_data(sdsc, buffer->buf, buffer->len);
}
......@@ -23,5 +23,3 @@ void stream_release_buffer(ref_buffer *buf);
int process_and_send_buffer(stream_description *sdsc, ref_buffer *buffer);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment