]> 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 17:40:37 +0000 (11:40 -0600)
commit3dc48fe65ca9722d3e0b6babd375192642ea0332
tree9fac379e39e42faa93871175555c2e76b7746a11
parentd0024a68e11183152b02181386009926fedcc778
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