GNOME Bugzilla – Bug 754356
event: Make sure that timestamp + diff in QoS events is never smaller than 0
Last modified: 2017-05-05 20:54:11 UTC
See commit message
Created attachment 310353 [details] [review] event: Make sure that timestamp + diff in QoS events is never smaller than 0 When a running-time-offset is stored in the event, it could become smaller than 0 although the event is otherwise correct. This can happen when pad offsets are used. To prevent this, we set the timestamp to -diff, so that in the end the sum of both is exactly 0.
Created attachment 310354 [details] [review] aggregator: Don't forward QOS events to sinkpads that had no buffer yet Otherwise they will receive a QOS event that has earliest_time=0 (because we can't have negative timestamps), and consider their buffer as too late
This is both not ideal yet btw, but it works. The first patch will put an arbitrary timestamp into the event, which together with the diff will lead to timestamp+diff=0. This causes less hard failures than before (integer overflow, so timestamp+diff was a huge number and everything was too late) but makes elements believe that now would be a good time to produce something for timestamp 0... which might just be what they currently produce. That leads to the second patch, where aggregator told newly added sinkpads with pad offsets in use somewhere that timestamp 0 is the earliest time now. And the first buffer was dropped because it had timestamp 0 (checks for dropping are buffer_running_time <= timestamp + diff).
commit a3513d6e977853a6f4d8a6062152f2b664ab8f34 Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Aug 31 15:35:11 2015 +0300 event: Make sure that timestamp + diff in QoS events is never smaller than 0 When a running-time-offset is stored in the event, it could become smaller than 0 although the event is otherwise correct. This can happen when pad offsets are used. To prevent this, we set the timestamp to -diff, so that in the end the sum of both is exactly 0. https://bugzilla.gnome.org/show_bug.cgi?id=754356
commit fc76c936f45e5123978b719ddd9e345a40850862 Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Aug 31 16:12:40 2015 +0300 aggregator: Don't forward QOS events to sinkpads that had no buffer yet Otherwise they will receive a QOS event that has earliest_time=0 (because we can't have negative timestamps), and consider their buffer as too late https://bugzilla.gnome.org/show_bug.cgi?id=754356
@slomo: You added a "first_buffer" element to the GstAggregatorPadPrivate without documenting the locking, which makes sense, as you didn't do any locking!