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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:09:19 +0000 (00:09 -0400)
commit5adae91a2c2cd4197aa7afa1cfc4bc8c96e2cbcd
tree9e75c2b20debc955586d67ee323707aa66aaec29
parent914ffd9732dfb544bc51ca6f980299858235cea1
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.024185 seconds and 5 git commands to generate.