[Asterisk-code-review] audiohook.c: Fix MixMonitor crash when using the r() or t() ... (asterisk[certified/13.1])

Matt Jordan asteriskteam at digium.com
Fri Aug 14 07:50:48 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: audiohook.c: Fix MixMonitor crash when using the r() or t() options.
......................................................................


audiohook.c: Fix MixMonitor crash when using the r() or t() options.

The built frame format in audiohook_read_frame_both() is now set to a
signed linear format before the rx and tx frames are duplicated instead of
only for the mixed audio frame duplication.

ASTERISK-25322 #close
Reported by Sean Pimental

Change-Id: I86f85b5c48c49e4e2d3b770797b9d484250a1538
---
M main/audiohook.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/main/audiohook.c b/main/audiohook.c
index e01b1ce..d1d0606 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -324,6 +324,8 @@
 		ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
 	}
 
+	frame.subclass.format = ast_format_cache_get_slin_by_rate(audiohook->hook_internal_samp_rate);
+
 	/* Basically we figure out which buffer to use... and if mixing can be done here */
 	if (read_buf && read_reference) {
 		frame.data.ptr = buf1;
@@ -349,8 +351,6 @@
 
 	/* Make the final buffer part of the frame, so it gets duplicated fine */
 	frame.data.ptr = final_buf;
-
-	frame.subclass.format = ast_format_cache_get_slin_by_rate(audiohook->hook_internal_samp_rate);
 
 	/* Yahoo, a combined copy of the audio! */
 	return ast_frdup(&frame);

-- 
To view, visit https://gerrit.asterisk.org/1090
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I86f85b5c48c49e4e2d3b770797b9d484250a1538
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list