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

Richard Mudgett asteriskteam at digium.com
Thu Aug 13 14:05:54 CDT 2015


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/1088

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-25315 #close
Reported by Sean Pimental

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


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/88/1088/1

diff --git a/main/audiohook.c b/main/audiohook.c
index ba1ecd4..ba72193 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -326,6 +326,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;
@@ -351,8 +353,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/1088
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86f85b5c48c49e4e2d3b770797b9d484250a1538
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list