Fix: flt.utils.trimmer: accept inited streams ending without other messages
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 23 Apr 2019 21:38:20 +0000 (17:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
commitc24092f22c45c5d827ff66303d1b5ca7b8f99991
tree902b87785217da40004d4ce665f778db208d1325
parent480c0b45f1ed901b29a7c8761d8fb3c424ec7c20
Fix: flt.utils.trimmer: accept inited streams ending without other messages

Issue
=====
It is possible that, for a given stream, an `flt.utils.trimmer`
component receives the stream beginning and stream beginnin activity
messages, and then it needs to be ended. In this case,
`sstate->stream_act_end_ns_from_origin` is never set, so we hit the
assertion.

Solution
========
When ending a stream and when `sstate->stream_act_end_ns_from_origin` is
not set for this stream, use the trimming range's end time as the stream
activity end time.

If `sstate->stream_act_end_ns_from_origin` is not set at this point,
then we know the stream is currently active, so it is safe to use a
specific time as its activity end time. If the last received message for
this stream was a stream activity end message, then we don't reach this
code because it's conditional to
`!sstate->last_msg_is_stream_activity_end`.

Known drawbacks
===============
None.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
plugins/utils/trimmer/trimmer.c
This page took 0.02396 seconds and 4 git commands to generate.