[Asterisk-code-review] audiohook: Use manipulated frame instead of dropping it. (asterisk[master])

Matt Jordan asteriskteam at digium.com
Wed Jul 22 20:02:30 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: audiohook: Use manipulated frame instead of dropping it.
......................................................................


audiohook: Use manipulated frame instead of dropping it.

Previous changes to sample rate support in audiohooks accidentally
removed code responsible for allowing the manipulate audiohooks
to work. Without this code the manipulated frame would be dropped
and not used. This change restores it.

ASTERISK-25253 #close

Change-Id: I3ff50664cd82faac8941f976fcdcb3918a50fe13
---
M main/audiohook.c
1 file changed, 9 insertions(+), 6 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Mark Michelson: 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 3e233fa..71b3574 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -1009,13 +1009,16 @@
 			audiohook_list_set_hook_rate(audiohook_list, audiohook, &internal_sample_rate);
 			/*
 			 * Feed in frame to manipulation.
-			 *
-			 * XXX FAILURES ARE IGNORED XXX
-			 * If the manipulation fails then the frame will be returned in its original state.
-			 * Since there are potentially more manipulator callbacks in the list, no action should
-			 * be taken here to exit early.
 			 */
-			audiohook->manipulate_callback(audiohook, chan, middle_frame, direction);
+			if (!audiohook->manipulate_callback(audiohook, chan, middle_frame, direction)) {
+				/*
+				 * XXX FAILURES ARE IGNORED XXX
+				 * If the manipulation fails then the frame will be returned in its original state.
+				 * Since there are potentially more manipulator callbacks in the list, no action should
+				 * be taken here to exit early.
+				 */
+				middle_frame_manipulated = 1;
+			}
 			ast_audiohook_unlock(audiohook);
 		}
 		AST_LIST_TRAVERSE_SAFE_END;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ff50664cd82faac8941f976fcdcb3918a50fe13
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp 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