diff options
author | Aleksandr Slobodeniuk <aslobodeniuk@fluendo.com> | 2022-12-01 10:34:10 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-12-01 23:52:40 +0000 |
commit | 38f6a0ba2e2152135a4c102048de9288b87b35d4 (patch) | |
tree | ca3ca1e9b71ccf11eb30694e20a248bd341d0401 | |
parent | 4cbdf43e7d2be8588290bd5859800e9f7a69c643 (diff) | |
download | gstreamer-38f6a0ba2e2152135a4c102048de9288b87b35d4.tar.gz |
rtspsrc: fix seek event leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3500>
-rw-r--r-- | subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c index 304563cc1b..63769f8308 100644 --- a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c +++ b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c @@ -1594,6 +1594,9 @@ gst_rtspsrc_finalize (GObject * object) if (rtspsrc->tls_interaction) g_object_unref (rtspsrc->tls_interaction); + if (rtspsrc->initial_seek) + gst_event_unref (rtspsrc->initial_seek); + /* free locks */ g_rec_mutex_clear (&rtspsrc->stream_rec_lock); g_rec_mutex_clear (&rtspsrc->state_rec_lock); @@ -9576,12 +9579,12 @@ gst_rtspsrc_send_event (GstElement * element, GstEvent * event) if (GST_EVENT_TYPE (event) == GST_EVENT_SEEK) { if (rtspsrc->state >= GST_RTSP_STATE_READY) { res = gst_rtspsrc_perform_seek (rtspsrc, event); - gst_event_unref (event); } else { /* Store for later use */ res = TRUE; - rtspsrc->initial_seek = event; + gst_event_replace (&rtspsrc->initial_seek, event); } + gst_event_unref (event); } else if (GST_EVENT_IS_DOWNSTREAM (event)) { res = gst_rtspsrc_push_event (rtspsrc, event); } else { |