]> git.ipfire.org Git - thirdparty/asterisk.git/commit
audiohook.c: Improve frame pairing logic to avoid MixMonitor breakage with mixed...
authorMichal Hajek <michal.hajek@daktela.com>
Wed, 21 May 2025 08:28:20 +0000 (10:28 +0200)
committerMichal Hajek <michal.hajek@daktela.com>
Wed, 2 Jul 2025 14:34:36 +0000 (14:34 +0000)
commit46d340c4249a2dd6ac8eebcc0cc0225e9121ff4b
treed889055745e9e55bff41ece5aebacd0c3c51ac60
parent371493087ae20b7a0ad3f9e05eebdbacbba6da0a
audiohook.c: Improve frame pairing logic to avoid MixMonitor breakage with mixed codecs

This patch adjusts the read/write synchronization logic in audiohook_read_frame_both()
to better handle calls where participants use different codecs or sample sizes
(e.g., alaw vs G.722). The previous hard threshold of 2 * samples caused MixMonitor
recordings to break or stutter when frames were not aligned between both directions.

The new logic uses a more tolerant limit (1.5 * samples), which prevents audio tearing
without causing excessive buffer overruns. This fix specifically addresses issues
with MixMonitor when recording directly on a channel in a bridge using mixed codecs.

Reported-by: Michal Hajek <michal.hajek@daktela.com>
Resolves: #1276
Resolves: #1279
main/audiohook.c