aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-18 06:00:18 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-18 06:00:18 +0000
commit15d2f7aa97d8aeb5c079eb0f8f12e34566cc25e3 (patch)
treef8415b483851763c16dc9983cd34c8bb265982d9 /res
parent5ed6a971dafbe158e7406bc15694187df80047c4 (diff)
Tue Mar 18 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@652 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rwxr-xr-xres/res_musiconhold.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index ab347f9d4..dc1839d03 100755
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -221,8 +221,8 @@ static void *monmp3thread(void *data)
res = read(class->pseudofd, buf, sizeof(buf));
} else {
/* otherwise just sleep (unreliable) */
- usleep(250000);
- res = 2000;
+ usleep(100000); /* Sleep 100 ms */
+ res = 800; /* 800 samples */
}
if (!class->members)
continue;
@@ -328,7 +328,7 @@ static struct mohdata *mohalloc(struct mohclass *cl)
static void moh_release(struct ast_channel *chan, void *data)
{
struct mohdata *moh = data, *prev, *cur;
- int oldrfmt, oldwfmt;
+ int oldwfmt;
ast_pthread_mutex_lock(&moh_lock);
/* Unlink */
prev = NULL;
@@ -350,8 +350,8 @@ static void moh_release(struct ast_channel *chan, void *data)
oldwfmt = moh->origwfmt;
free(moh);
if (chan) {
- if (ast_set_write_format(chan, oldwfmt))
- ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %d/%d\n", chan->name, oldwfmt, oldrfmt);
+ if (oldwfmt && ast_set_write_format(chan, oldwfmt))
+ ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %d\n", chan->name, oldwfmt);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
}