]> 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)
committerGeorge Joseph <gjoseph@sangoma.com>
Wed, 17 Sep 2025 19:36:50 +0000 (13:36 -0600)
commit0401fd711d9c189e04c74e9ece3f747a8e26b7ec
treeb4f4da63942bb6eb5e3f3606b551abab9068c4d9
parent0c4fe6810ba736604384833bcf62c146fa6890b1
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