diff options
author | Matteo Brancaleoni <mbrancaleoni@espia.it> | 2003-03-18 06:00:18 +0000 |
---|---|---|
committer | Matteo Brancaleoni <mbrancaleoni@espia.it> | 2003-03-18 06:00:18 +0000 |
commit | 2c64ccad0fbca62fe1528e19f551c14db46366cd (patch) | |
tree | f8415b483851763c16dc9983cd34c8bb265982d9 /res | |
parent | 0954f713fcd63f0c8462fb25302dde8626aab151 (diff) |
Tue Mar 18 07:00:01 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_musiconhold.c | 10 |
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); } |