[Asterisk-code-review] res_musiconhold: Start playlist after initial announcement (asterisk[13])

Sean Bright asteriskteam at digium.com
Fri Sep 18 15:03:20 CDT 2020


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14931 )


Change subject: res_musiconhold: Start playlist after initial announcement
......................................................................

res_musiconhold: Start playlist after initial announcement

Only track our sample offset if we are playing a non-announcement file,
otherwise we will skip that number of samples when we start playing the
first MoH file.

ASTERISK-24329 #close

Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc
---
M res/res_musiconhold.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/31/14931/1

diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index b229f4d..eac434d 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -475,7 +475,12 @@
 			return -1;
 		}
 
-		state->samples += f->samples;
+		/* Only track our offset within the current file if we are not in the
+		 * the middle of an announcement */
+		if (!state->announcement) {
+			state->samples += f->samples;
+		}
+
 		state->sample_queue -= f->samples;
 		if (ast_format_cmp(f->subclass.format, state->mohwfmt) == AST_FORMAT_CMP_NOT_EQUAL) {
 			ao2_replace(state->mohwfmt, f->subclass.format);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14931
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc
Gerrit-Change-Number: 14931
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200918/0c5d621c/attachment.html>


More information about the asterisk-code-review mailing list