Files
asterisk/main
George Joseph bc973bd719 jitterbuffer: Correct signed/unsigned mismatch causing assert
If the system time has stepped backwards because of a time
adjustment between the time a frame is timestamped and the
time we check the timestamps in abstract_jb:hook_event_cb(),
we get a negative interval, but we don't check for that there.
abstract_jb:hook_event_cb() then calls
fixedjitterbuffer:fixed_jb_get() (via abstract_jb:jb_get_fixed)
and the first thing that does is assert(interval >= 0).

There are several issues with this...

 * abstract_jb:hook_event_cb() saves the interval in a variable
   named "now" which is confusing in itself.

 * "now" is defined as an unsigned int which converts the negative
   value returned from ast_tvdiff_ms() to a large positive value.

 * fixed_jb_get()'s parameter is defined as a signed int so the
   interval gets converted back to a negative value.

 * fixed_jb_get()'s assert is NOT an ast_assert but a direct define
   that points to the system assert() so it triggers even in
   production mode.

So...

 * hook_event_cb()'s "now" was renamed to "relative_frame_start" and
   changed to an int64_t.
 * hook_event_cb() now checks for a negative value right after
   retrieving both the current and framedata timestamps and just
   returns the frame if the difference is negative.
 * fixed_jb_get()'s local define of ASSERT() was changed to call
   ast_assert() instead of the system assert().

ASTERISK-29480
Reported by: Dan Cropp

Change-Id: Ic469dec73c2edc3ba134cda6721a999a9714f3c9
2021-06-24 08:18:19 -05:00
..
2019-08-01 15:31:48 -06:00
2020-05-05 10:06:43 -05:00
2020-05-05 10:06:43 -05:00
2020-04-06 10:23:20 -05:00
2019-08-01 15:31:48 -06:00
2020-10-02 12:58:18 -05:00
2021-01-04 05:00:58 -06:00
2020-06-10 09:33:28 -05:00
2020-08-18 05:16:43 -05:00
2021-01-04 05:00:58 -06:00
2020-06-10 09:33:28 -05:00
2017-12-20 12:40:01 -05:00
2020-10-02 12:58:18 -05:00
2018-06-23 08:26:19 +02:00
2018-07-23 06:47:20 -05:00