Skip to content
  • Sebastian Dröge's avatar
    appsrc/appsink: Make setting/replacing callbacks thread-safe · 9a55945c
    Sebastian Dröge authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    Previously we would simply use them without any locking at all, while
    using the object lock for setting them. Nothing prevented new callbacks
    to be set in the meantime, potentially calling a callback with already
    freed user_data.
    
    To prevent this move the callbacks into a reference counted struct and
    use the appsrc/appsink mutex to protect access to it, which is used in
    all functions calling the callbacks already anyway.
    
    Fixes gstreamer/gst-plugins-base#729
    9a55945c