GNOME Bugzilla – Bug 774831
queue2: handle overwriting the current range correctly
Last modified: 2018-11-03 12:38:28 UTC
Created attachment 340491 [details] [review] queue2: handle overwriting the current range correctly This basically reverts b3802f7a9e7988901367196dd3dc45cf4053d850 ("queue2: fix crash deleting current region for small ring buffers") and fixes the original problem correctly. Ignoring the current range while checking which ranges must be truncated or removed is incorrect. With just one range, it it possible, that the offset of the current range must be adjusted because the corresponding data will be overwritten. To fix the original problem, the current range is never removed. Instead it may be truncated to zero length before the new data is appended. Note: The test-case from the original commit still works and my test-case (seeking backwards to a position in the current range that was overwritten but not removed from the range) works again. But I'm not 100% sure I got all possible corner cases, so someone with better understanding of queue2 should probably double check this.
Can you also add a test for your new case?
AFAICT, this restores the adjustments to the current range which b3802f7a9e7988901367196dd3dc45cf4053d850 would have also bypassed, by checking for current only when actually removing. I don't claim to understand how the range code all works, but the patch looks OK to me.
This triggers the bug for me: gst-validate-1.0 --set-scenario trick_mode_seeks \ playbin ring-buffer-max-size=50000 \ uri=http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/tears_of_steel_720p.mov
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/208.