The decoder output frame was hard-coded to 960 samples, which is 20 ms
at 48 kHz. libopus refuses to decode a packet that does not fit the
given frame size, so every 40 ms and 60 ms packet (both ptimes accepted
by opus_init) failed with "buffer too small" and was dropped.
Size the buffer for 120 ms, the longest duration an Opus packet can
carry, at the decoder's clock rate.
Closes#2224
Change-Id: Ic2fcb32977ad0e262d42b74948103b0f68511d95
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 47cd1458a7)
When the negotiated fmtp has a bitrate range (br=A-B), the encoder's
lower bound check compared the bitrate against max_br instead of
min_br. Any bitrate below the upper bound was therefore forced down
to the minimum, e.g. br=9.6-24.4 with the default 16.4 kbit/s ended
up encoding at 9.6 kbit/s instead of staying at 16.4.
Compare against min_br so the bitrate is only raised when it is
actually below the lower bound.
Closes#2223
Change-Id: I8bfaff332476e351e0b7a6a375a9c55bb3fa772f
(cherry picked from commit 0402477b96)
stats->ext_seq has been the SRTP receive index since srtp_index moved into
shm (08c7f5853d). The transcode sequencer overwrote it after every
emitted packet with its own roc<<16|seq, which lags the received packets
and, whenever the sequencer emits a late or replayed packet with a lower
sequence number, carries a roc that was incremented without a real
wrap-around. packet_index() then estimated the wrong index, and once the
sender's real roc reached 1 none of the fallback guesses matched, so every
packet of the stream failed authentication until the call ended.
packet_index() already maintains the index for every received packet, so
drop the write. Also make the sequencer's own roc increment only on a
forward wrap-around, never on a backwards step.
Closes#2221
Change-Id: Ia38bf8cbc63dd3435717927f1adfd81ac94ea347
(cherry picked from commit 956d7add09)
Ref #2211
cli_handle() takes a str, but most "set" handlers parsed their value
with strtol(), strtod() or atoi() on instr->s and printed it with "%s",
reading up to the next NUL. The ng "cli" command passes a slice of the
request: "set maxsessions 1000" set 10007, "set rediscmdtimeout 0" set
7 ms, and error messages quoted the rest of the request.
Parse with the str_to_X helpers, plus a new str_to_d for maxcpu and
maxload, and print with STR_FORMAT. As with the str_to_X family, a
value with trailing characters ("10x") is refused, and so is a
non-number in the seven handlers that read it as 0. "terminate" now
matches all, own and foreign exactly (str_cmp()), not as a prefix.
Tested by auto-daemon-tests-redis-errors.pl and the new t/test-str.c.
Change-Id: I92ed33a4229688aba513c3d0410b9d77a8bcd516
(cherry picked from commit f54da0bcec)
Per RFC 4867 section 8.1, absent fmtp parameters imply defaults (bandwidth-efficient mode, no CRC,
no robust-sorting, no interleaving). Previously, codec matching was rejected when either side had no
``a=fmtp`` attribute for the AMR payload type, causing AMR to be dropped as a "stray answer codec".
This patch changes this behavior to instead "parse" fmtp even when absent so that the format struct
is populated with zero-initialized defaults and fmtp_parsed is set.
Closes#2141
Change-Id: I1371cb1fdb9354746a4019477845d777e619a2f6
(cherry picked from commit 702ccec969)
(cherry picked from commit 84d62960a3)
We use `family == NULL` as test for the socket being open in several
places, and expect it to match the familt of the addresses. Set it to
zero to make it consistent.
Change-Id: Ide2b41e84fc27b5f47f579dcf4ab2ec2f6b0a37e
(cherry picked from commit 16de9688d6)
ffmpeg's CNG expects a fixed frame size, or at least a maximum frame
size, as it allocates internal buffers on construction based on that
frame size. Calling the decoder with a larger frame size therefore leads
to an internal buffer overflow. Calling it with a smaller frame size is
fine.
Retain the simple one-shot CNG for the most common case (frame size
smaller than the max). For larger frames, call the CNG in a loop and
manually construct a return frame.
Change-Id: I0ebe0b7a9ad8a08bbabd0d8dea264b08cb44feee
(cherry picked from commit dfcb9a8322)
Make sure data is 64-bit aligned. Fixes alignment issues on certain
32-bit archs (armhf).
Change-Id: I66c1fc20e97c62d3d5e266e874812aed74d295ed
(cherry picked from commit 31375ca349)
Use a pointer to the arena plus a comparison test to determine whether
to ref or to dup the string, instead of a function pointer. The function
pointer alone wasn't enough as there can be multiple arenas.
Change-Id: Icd317e524fc2e5842f90d172ef7089d2cb0a5a28
Previously, rtpengine would refuse to resolve any hostnames longer than
64 characters.
Closes#2061
Change-Id: I5fe6c05f59a449f6e3b6b0f403d438626905101b
Track last sent seq and read responses until a relevant one is received.
Seems like NEWRULE sometimes (not always) produces two ACKs.
Change-Id: Id650ea4db3a685a2b06d4ab29572ac8d6cfb06fe
Not 100% sure if this is how it's intended to be handled, as the failed
requests seem to produce multiple ACK messages, but at least this fixes
the immediate problem of the printed error message not matching the
request which failed.
Closes#2041
Change-Id: I2a6bf57ce996c134b44d4f3484164a39c68fc93c