]> 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)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 2 Jul 2025 14:34:42 +0000 (14:34 +0000)
commit4522eb1222087be3cca2b56c3ed7187994e55a7e
treec2321c57d06458ea3a2c76c8d38773a2291ac1c0
parent574ddb9eaee59b4b52c400f9d4a22c10e2af4d09
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