Switch from thread-local allocated string object to a stack allocated
one. Use auto cleanup to manage storage duration and final logging.
Fixes intermittent random failures of the leak checker.
Change-Id: Ie6afb27e6fd1accbe641fc62175d553a0558de0d
Remove the actual hash and just keep a linked list. Always move most
recently used entries to the front of the list, which also obsoletes
tracking the last used time stamp.
Change-Id: Id277499228b538dd013a4442e9b5c5a4d247ff15
Keep outgoing RTP timestamps consistent between different instances of
the DTX buffer. Update affected tests.
Change-Id: I6cf03ab32f5c510bd781063a9e7241d1187c202b
If the last used PT was a different one, check if it was an unknown PT.
If it was, then DTX can remain active, as the packet would have been
blocked.
Change-Id: Icc8bf195c30a2252b392bbccfeef34b91078ddd6
The stub is used for unknown payload types. Specialise the handler
function for it with an extra check for DTX usage. This effectively
blocks RTP packets with unknown payload types if DTX has been
configured. Forwarding RTP packets with unknown payload types can
interfere with a clean output stream generated by the DTX buffer.
Change-Id: I6f0aa9654946d2877b963cd13cec7c3f5c8b1c54
Shutting down a DTX buffer means that it may restart at an unknown later
time. Reset TS tracking when shutting it down so that if it does
restart, it receives a fresh TS state, instead of continuing on the
previous timestamps, which may then be wrong.
Change-Id: I9c7978e2f335eab32982c4739917ca5ce0c27eb6
Extend PT tracker to not just track the most used PT, but also which PT
has been used last. Use a simple circular array.
Use this new tracking to determine whether a DTX buffer should remain
active. The "most used PT" approach isn't reliable for this, as it leads
to a DTX buffer restarting only after the PT has become the "most used,"
so only after about 10 packets. Meanwhile a newly appearing SSRC would
have a new DTX buffer active immediately. Being strict about which PT
was used last resolves this inconsistency.
Change-Id: If912e4d10e6737a82f6adc0b19d502075aa18a93
If a packet is received for a codec that should have an active DTX but
doesn't, drop the packet instead of forwarding it without being
processed. In this case we expect that some other codec has an active
DTX buffer, and forwarding the packet would interfere with a clean
output stream.
Change-Id: I162ba6f314b804123a6a3957feb7435a319ad2b9
The GLib slice allocator has been obsoleted. Having a mixture of two
allocators can lead to hidden issues on systems that use different
implementations. Take the leap and replace everything with g_new/g_free.
Change-Id: I025c8383ef47b2c2472573360407fd6a6ca339b3
Media IDs are supposed to be unique. Non-RFC OSRTP may however lead to
duplicated media sections with the same media ID. Use a hash table to
track which media IDs have already been seen, and ignore any duplicates.
Change-Id: I9de5fdf3165fc4326862af708aec3d4f6736cb12
This mode is only supposed to be used by cases when:
- in-dialog offerer doesn't have own MoH capabilities; and
- still want the recipient to hear the MoH music; hence
- an offerer checks whether a recipient is capable of MoH,
and launches a player based on given capabilities;
- the rest functions the same as with usual MoH hold;
Other information:
- `mode=reflect` is only to be used within dialog,
so, it's not meant for a session origination,
and hence stands alone from other MoH option flags
that actually give a metadata (e.g. blob data)
- `mode=reflect` hence contradicts with `mode=sendrecv`
which in its turn serves another purpose
Usage:
- `moh => { mode => 'reflect' }`
Change-Id: I8d0d55f2711c6b47bfca17691582c1ffe66eae3d