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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_ices.c b/apps/app_ices.c
index f2b9498a6..b7eea944c 100644
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -111,12 +111,13 @@ static int ices_exec(struct ast_channel *chan, const char *data)
int ms = -1;
int pid = -1;
int flags;
- int oreadformat;
+ struct ast_format oreadformat;
struct timeval last;
struct ast_frame *f;
char filename[256]="";
char *c;
+ ast_format_clear(&oreadformat);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "ICES requires an argument (configfile.xml)\n");
return -1;
@@ -143,8 +144,8 @@ static int ices_exec(struct ast_channel *chan, const char *data)
return -1;
}
- oreadformat = chan->readformat;
- res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+ ast_format_copy(&oreadformat, &chan->readformat);
+ res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR);
if (res < 0) {
close(fds[0]);
close(fds[1]);
@@ -195,8 +196,8 @@ static int ices_exec(struct ast_channel *chan, const char *data)
if (pid > -1)
kill(pid, SIGKILL);
- if (!res && oreadformat)
- ast_set_read_format(chan, oreadformat);
+ if (!res && oreadformat.id)
+ ast_set_read_format(chan, &oreadformat);
return res;
}