Skip to content

imagefreeze: Handle flushing correctly

First of all get rid of the atomic seeking boolean, which was only ever set and never read. Replace it with a flushing boolean that is used in the loop function to distinguish no buffer because of flushing and no buffer because of an error as otherwise we could end up in a GST_FLOW_ERROR case during flushing.

Also only reset the state of imagefreeze in flush-stop when all processing is stopped instead of doing it as part of flush-start.

And last, get a reference to the imagefreeze buffer in the loop function in the very beginning and work from that as otherwise it could in theory be replaced or set to NULL in the meantime as we release and re-take the mutex a couple of times during the loop function.

Merge request reports