On Wed May 24 18:44:37 2023 +0000, Zebediah Figura wrote:
Patch 5/10 doesn't make much sense by itself. Looking ahead, it seems to be used to send segment-done events, but this seems like an unclear way to achieve that—clearer would be to explicitly store the last pts separately and just use that. However, stepping back, the segment-done logic is concerning. GStreamer is annoyingly underdocumented here, and it's not clear to me that it's actually legal to send segment-done with a different timestamp than the previous segment event. Moreover, though, it's not actually clear to me why we need to?
We don't have to send the segment end timestamp, and it works just the same if we use -1 like for when it was started. What matters it to restore the timestamp for stream start so that buffer times are kept consistent.
I don't see how it is different to keep the timestamp in a field vs keep the segment. I prefer keeping the segment as it saves useless local variable (and segment initialization every time we want to create one).