Commit 883649ca authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Update: Refactored code to be less creative

parent 58d89b5d
......@@ -91,7 +91,7 @@ void *ices_instance_stream(void *arg)
signal(SIGPIPE, signal_hup_handler);
#endif
if (!(shout_set_host(sdsc->shout, stream->hostname)) == SHOUTERR_SUCCESS) {
if (shout_set_host(sdsc->shout, stream->hostname) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
......@@ -100,35 +100,35 @@ void *ices_instance_stream(void *arg)
shout_set_port(sdsc->shout, stream->port);
#if SHOUT_TLS
if (!(shout_set_tls(sdsc->shout, stream->tls)) == SHOUTERR_SUCCESS) {
if (shout_set_tls(sdsc->shout, stream->tls) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream->ca_directory)
if (!(shout_set_ca_directory(sdsc->shout, stream->ca_directory)) == SHOUTERR_SUCCESS) {
if (shout_set_ca_directory(sdsc->shout, stream->ca_directory) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream->ca_file)
if (!(shout_set_ca_file(sdsc->shout, stream->ca_file)) == SHOUTERR_SUCCESS) {
if (shout_set_ca_file(sdsc->shout, stream->ca_file) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream->allowed_ciphers)
if (!(shout_set_allowed_ciphers(sdsc->shout, stream->allowed_ciphers)) == SHOUTERR_SUCCESS) {
if (shout_set_allowed_ciphers(sdsc->shout, stream->allowed_ciphers) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream->client_certificate)
if (!(shout_set_client_certificate(sdsc->shout, stream->client_certificate)) == SHOUTERR_SUCCESS) {
if (shout_set_client_certificate(sdsc->shout, stream->client_certificate) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
......@@ -136,7 +136,7 @@ void *ices_instance_stream(void *arg)
#endif
if (!(shout_set_password(sdsc->shout, stream->password)) == SHOUTERR_SUCCESS) {
if (shout_set_password(sdsc->shout, stream->password) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
......@@ -152,18 +152,18 @@ void *ices_instance_stream(void *arg)
return NULL;
}
if (!(shout_set_agent(sdsc->shout, PACKAGE_STRING)) == SHOUTERR_SUCCESS) {
if (shout_set_agent(sdsc->shout, PACKAGE_STRING) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (!(shout_set_mount(sdsc->shout, stream->mount)) == SHOUTERR_SUCCESS) {
if (shout_set_mount(sdsc->shout, stream->mount) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (shout_set_public (sdsc->shout, stream->public_stream & 1) != SHOUTERR_SUCCESS)
if (shout_set_public(sdsc->shout, stream->public_stream ? 1 : 0) != SHOUTERR_SUCCESS)
{
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
......@@ -192,25 +192,25 @@ void *ices_instance_stream(void *arg)
stream_url = ices_config->stream_url;
if(stream_name)
if (!(shout_set_name(sdsc->shout, stream_name)) == SHOUTERR_SUCCESS) {
if (shout_set_name(sdsc->shout, stream_name) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream_genre)
if (!(shout_set_genre(sdsc->shout, stream_genre)) == SHOUTERR_SUCCESS) {
if (shout_set_genre(sdsc->shout, stream_genre) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream_description)
if (!(shout_set_description(sdsc->shout, stream_description)) == SHOUTERR_SUCCESS) {
if (shout_set_description(sdsc->shout, stream_description) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if (stream_url)
if (!(shout_set_url(sdsc->shout, stream_url) == SHOUTERR_SUCCESS)) {
if (shout_set_url(sdsc->shout, stream_url) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
......
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