Commit 03f1f61e authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Feature: Support sending the content language

parent d9b73a27
......@@ -381,6 +381,8 @@ static void _parse_stream(config_t *config, xmlDocPtr doc, xmlNodePtr node)
if (strcmp(node->name, "metadata") == 0)
_parse_metadata(NULL, config, doc, node->xmlChildrenNode);
else if (strcmp(node->name, "content-language") == 0)
SET_STRING(config->content_language);
else if (strcmp(node->name, "input") == 0)
_parse_input(config, doc, node->xmlChildrenNode);
else if (strcmp(node->name, "instance") == 0)
......@@ -425,6 +427,8 @@ static void _set_defaults(config_t *c)
c->loglevel = DEFAULT_LOGLEVEL;
c->log_stderr = DEFAULT_LOG_STDERR;
c->content_language = NULL;
c->stream_name = xmlStrdup(DEFAULT_STREAM_NAME);
c->stream_genre = xmlStrdup(DEFAULT_STREAM_GENRE);
c->stream_description = xmlStrdup(DEFAULT_STREAM_DESCRIPTION);
......@@ -488,6 +492,9 @@ void config_shutdown(void)
if (ices_config->playlist_module)
xmlFree(ices_config->playlist_module);
if (ices_config->content_language)
xmlFree(ices_config->content_language);
if (ices_config->stream_name)
xmlFree(ices_config->stream_name);
if (ices_config->stream_genre)
......
......@@ -92,6 +92,7 @@ typedef struct _config_tag
int log_stderr;
/* <stream> */
char *content_language;
/* <metadata> */
......
......@@ -187,6 +187,11 @@ void *ices_instance_stream(void *arg)
_set_meta(stream_genre, SHOUT_META_GENRE);
_set_meta(stream_description, SHOUT_META_DESCRIPTION);
if (shout_set_content_language(sdsc->shout, ices_config->content_language) != SHOUTERR_SUCCESS) {
LOG_ERROR1("libshout error: %s\n", shout_get_error(sdsc->shout));
stream->died = 1;
return NULL;
}
if(stream->downmix && encoding && stream->channels == 1) {
stream->channels = 1;
......
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