summaryrefslogtreecommitdiff
path: root/apps/app_ices.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_ices.c')
-rw-r--r--apps/app_ices.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/app_ices.c b/apps/app_ices.c
index a043d3de4..b52c1517d 100644
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -21,7 +21,7 @@
* \brief Stream to an icecast server via ICES (see contrib/asterisk-ices.xml)
*
* \author Mark Spencer <markster@digium.com>
- *
+ *
* ICES - http://www.icecast.org/ices.php
*
* \ingroup applications
@@ -30,7 +30,7 @@
/*** MODULEINFO
<support_level>extended</support_level>
***/
-
+
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -79,7 +79,7 @@ static int icesencode(char *filename, int fd)
int res;
res = ast_safe_fork(0);
- if (res < 0)
+ if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res) {
return res;
@@ -90,8 +90,8 @@ static int icesencode(char *filename, int fd)
dup2(fd, STDIN_FILENO);
ast_close_fds_above_n(STDERR_FILENO);
- /* Most commonly installed in /usr/local/bin
- * But many places has it in /usr/bin
+ /* Most commonly installed in /usr/local/bin
+ * But many places has it in /usr/bin
* As a last-ditch effort, try to use PATH
*/
execl(path_LOCAL "ices2", "ices", filename, SENTINEL);
@@ -124,18 +124,18 @@ static int ices_exec(struct ast_channel *chan, const char *data)
ast_log(LOG_WARNING, "ICES requires an argument (configfile.xml)\n");
return -1;
}
-
+
if (pipe(fds)) {
ast_log(LOG_WARNING, "Unable to create pipe\n");
return -1;
}
ast_fd_set_flags(fds[1], O_NONBLOCK);
-
+
ast_stopstream(chan);
if (ast_channel_state(chan) != AST_STATE_UP)
res = ast_answer(chan);
-
+
if (res) {
close(fds[0]);
close(fds[1]);
@@ -156,10 +156,10 @@ static int ices_exec(struct ast_channel *chan, const char *data)
ast_copy_string(filename, (char *) data, sizeof(filename));
else
snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_CONFIG_DIR, (char *)data);
- /* Placeholder for options */
+ /* Placeholder for options */
c = strchr(filename, '|');
if (c)
- *c = '\0';
+ *c = '\0';
res = icesencode(filename, fds[0]);
if (res >= 0) {
pid = res;
@@ -214,4 +214,3 @@ static int load_module(void)
}
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices");
-