urisourcebin: Make sure event is writable before modifying.
authorJan Schmidt <jan@centricular.com>
Fri, 30 Sep 2022 18:40:09 +0000 (04:40 +1000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 3 Oct 2022 16:40:49 +0000 (16:40 +0000)
Make sure we're operating on a private copy of an event before
modifying it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3107>

subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c

index c362779..67d1a27 100644 (file)
@@ -903,9 +903,13 @@ demux_pad_events (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
       remove_buffering_msgs (urisrc,
           GST_OBJECT_CAST (child_info->output_slot->queue));
 
-      /* Mark this custom EOS */
+      /* Mark this custom EOS, replacing the event in the probe data */
+      ev = gst_event_make_writable (ev);
+      GST_PAD_PROBE_INFO_DATA (info) = ev;
+
       gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (ev), CUSTOM_EOS_QUARK,
           (gchar *) CUSTOM_EOS_QUARK_DATA, NULL);
+
       if (all_streams_eos) {
         GST_DEBUG_OBJECT (urisrc, "POSTING ABOUT TO FINISH");
         g_signal_emit (urisrc,