aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-16 21:28:10 +0000
committerdhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-16 21:28:10 +0000
commit2acf829f7091e5332a01d16ee96b21a702fe6b87 (patch)
tree0b2cebe7ac289663ca1b8d1a3994f7d70edc2ee6
parent2da2d9f84712923ec30537295463beb022a9dd40 (diff)
Merged revisions 257713 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r257713 | dhubbard | 2010-04-16 16:22:30 -0500 (Fri, 16 Apr 2010) | 28 lines Merged revisions 257686 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r257686 | dhubbard | 2010-04-16 16:15:43 -0500 (Fri, 16 Apr 2010) | 21 lines Make the mixmonitor thread process audio frames faster Mantis issue 17078 reports MixMonitor recordings have shorter durations than the call duration. This was because the mixmonitor thread was not processing frames from the audiohook fast enough. The mixmonitor thread would slowly fall behind the most recent audio frame and when the channel hangs up, the mixmonitor thread would exit without processing the same number of frames as the channel; leaving the mixmonitor recording shorter than actual call duration. This revision fixes this issue by moving the ast_audiohook_trigger_wait() and the subsequent audiohook.status check into the block where the ast_audiohook_read_frame() function returns NULL. (closes issue #17078) Reported by: geoff2010 Patches: dw-M17078.patch uploaded by dhubbard (license 733) Tested by: dhubbard, geoff2010 Review: https://reviewboard.asterisk.org/r/611/ ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@257738 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_mixmonitor.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index d30130748..4b127e302 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -245,13 +245,14 @@ static void *mixmonitor_thread(void *obj)
while (mixmonitor->audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING && !mixmonitor->mixmonitor_ds->fs_quit) {
struct ast_frame *fr = NULL;
- ast_audiohook_trigger_wait(&mixmonitor->audiohook);
+ if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR))) {
+ ast_audiohook_trigger_wait(&mixmonitor->audiohook);
- if (mixmonitor->audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING)
- break;
-
- if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR)))
+ if (mixmonitor->audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING) {
+ break;
+ }
continue;
+ }
/* audiohook lock is not required for the next block.
* Unlock it, but remember to lock it before looping or exiting */