Skip to content
Snippets Groups Projects
  • Sebastian Dröge's avatar
    e5feaa76
    imagefreeze: Handle flushing correctly · e5feaa76
    Sebastian Dröge authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    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.
    
    Part-of: <gstreamer/gst-plugins-good!580>
    e5feaa76
    History
    imagefreeze: Handle flushing correctly
    Sebastian Dröge authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    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.
    
    Part-of: <gstreamer/gst-plugins-good!580>
gstimagefreeze.h 2.17 KiB