From 2c64ccad0fbca62fe1528e19f551c14db46366cd Mon Sep 17 00:00:00 2001 From: Matteo Brancaleoni Date: Tue, 18 Mar 2003 06:00:18 +0000 Subject: Tue Mar 18 07:00:01 CET 2003 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@652 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_musiconhold.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'res/res_musiconhold.c') 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); } -- cgit v1.2.3