On Fri Oct 20 18:18:53 2023 +0000, Zebediah Figura wrote:
Ah, sorry, I managed to misread this line as doing something more hacky than it is. It's a little easier to read written as "stream_time + diff*100 < 0" [and a temp variable to hold diff*100 would probably also help]. We do want to fix that warning if we can. It's still a bit odd, because IIRC gst_segment_to_running_time() is supposed to just return -1 for positions that are out of bounds. What are the values that quartz is giving us? Are they generated by our sink or the application's sink?
That's how GStreamer's check looks, I just copied it and didn't really think about it.
It tries to create one QOS event every frame. Most of them succeed.
``` 01e4:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 1000, late -0.4180444, timestamp -0.2. 01e4:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 1.0000000000000000e+00, diff 0, timestamp 0. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 1000, late -0.4433777, timestamp -0.192. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 1.0000000000000000e+00, diff 0, timestamp 0. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.062711, timestamp 0.222. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -627110, timestamp 2220000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.0640444, timestamp 0.254. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -640444, timestamp 2540000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.0633777, timestamp 0.288. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -633777, timestamp 2880000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.063711, timestamp 0.321. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -637110, timestamp 3210000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.0630444, timestamp 0.355. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -630444, timestamp 3550000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.0633777, timestamp 0.388. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -633777, timestamp 3880000. 01dc:trace:quartz:source_quality_control_Notify filter 00379A98, sender 0AAB11EC, type 0, proportion 2000, late -0.062711, timestamp 0.422. 01dc:trace:quartz:wg_parser_stream_notify_qos stream 0x7ff2a80afe30, underflow 0, proportion 5.0000000000000000e-01, diff -627110, timestamp 4220000. (etc) ``` Looks to me like Wine is correctly discarding events where stream_time is out of bounds, but if stream_time is right at the start and diff pushes it out of bounds, it does something wrong.
I think the best solution is to clamp the diff to stay within the stream. Pushed.