From 833280b0f9de86c30ce88c406ef0307892882e7f Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Tue, 20 Apr 2021 18:47:31 -0400 Subject: [PATCH] asfdemux: Drop duplicate seek events. Part-of: --- gst/asfdemux/gstasfdemux.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 8f68908..2cf236c 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -48,6 +48,9 @@ #include "asfheaders.h" #include "asfpacket.h" +GST_DEBUG_CATEGORY (asfdemux_dbg); +#define GST_CAT_DEFAULT asfdemux_dbg + static GstStaticPadTemplate gst_asf_demux_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -78,8 +81,6 @@ GST_STATIC_PAD_TEMPLATE ("video_%u", (flow == ASF_FLOW_NEED_MORE_DATA) ? \ "need-more-data" : gst_flow_get_name (flow) -GST_DEBUG_CATEGORY (asfdemux_dbg); - static void gst_asf_demux_finalize (GObject * object); static GstStateChangeReturn gst_asf_demux_change_state (GstElement * element, GstStateChange transition); @@ -853,12 +854,21 @@ gst_asf_demux_handle_src_event (GstPad * pad, GstObject * parent, { GstASFDemux *demux; gboolean ret; + guint32 seqnum; demux = GST_ASF_DEMUX (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: GST_LOG_OBJECT (pad, "seek event"); + seqnum = gst_event_get_seqnum (event); + if (demux->segment_seqnum == seqnum) { + GST_LOG_OBJECT (pad, + "Drop duplicated SEEK event seqnum %" G_GUINT32_FORMAT, seqnum); + gst_event_unref (event); + ret = TRUE; + break; + } ret = gst_asf_demux_handle_seek_event (demux, event); gst_event_unref (event); break; @@ -1788,7 +1798,6 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force) demux->taglist = NULL; demux->need_newsegment = FALSE; - demux->segment_seqnum = 0; demux->segment_running = TRUE; } -- 2.7.4