diff --git a/gst-plugin-threadshare/src/appsrc.rs b/gst-plugin-threadshare/src/appsrc.rs index 9da54f04..3eaf298e 100644 --- a/gst-plugin-threadshare/src/appsrc.rs +++ b/gst-plugin-threadshare/src/appsrc.rs @@ -379,13 +379,6 @@ impl AppSrc { if state.need_initial_events { gst_debug!(self.cat, obj: element, "Pushing initial events"); - if let Some(event) = Self::create_io_context_event(&state) { - events.push(event); - - // Get rid of reconfigure flag - self.src_pad.check_reconfigure(); - } - let stream_id = format!("{:08x}{:08x}", rand::random::(), rand::random::()); events.push(gst::Event::new_stream_start(&stream_id).build()); if let Some(ref caps) = self.settings.lock().unwrap().caps { @@ -396,6 +389,12 @@ impl AppSrc { gst::Event::new_segment(&gst::FormattedSegment::::new()).build(), ); + if let Some(event) = Self::create_io_context_event(&state) { + events.push(event); + + // Get rid of reconfigure flag + self.src_pad.check_reconfigure(); + } state.need_initial_events = false; } else if self.src_pad.check_reconfigure() { if let Some(event) = Self::create_io_context_event(&state) { diff --git a/gst-plugin-threadshare/src/udpsrc.rs b/gst-plugin-threadshare/src/udpsrc.rs index 73abbfdf..f777cf45 100644 --- a/gst-plugin-threadshare/src/udpsrc.rs +++ b/gst-plugin-threadshare/src/udpsrc.rs @@ -317,13 +317,6 @@ impl UdpSrc { if state.need_initial_events { gst_debug!(self.cat, obj: element, "Pushing initial events"); - if let Some(event) = Self::create_io_context_event(&state) { - events.push(event); - - // Get rid of reconfigure flag - self.src_pad.check_reconfigure(); - } - let stream_id = format!("{:08x}{:08x}", rand::random::(), rand::random::()); events.push(gst::Event::new_stream_start(&stream_id).build()); if let Some(ref caps) = self.settings.lock().unwrap().caps { @@ -334,6 +327,12 @@ impl UdpSrc { gst::Event::new_segment(&gst::FormattedSegment::::new()).build(), ); + if let Some(event) = Self::create_io_context_event(&state) { + events.push(event); + + // Get rid of reconfigure flag + self.src_pad.check_reconfigure(); + } state.need_initial_events = false; } else if self.src_pad.check_reconfigure() { if let Some(event) = Self::create_io_context_event(&state) {