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)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commitcb179cb696e8f6ac200a788a76dd2e1e4314fe48
tree9e75c2b20debc955586d67ee323707aa66aaec29
parentf855116da5142f79b5d8da70085a1595787fef3f
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.025115 seconds and 4 git commands to generate.