From 7a8e48e17c19317136e7b87ceaa09ea718eece00 Mon Sep 17 00:00:00 2001 From: Fabrizio Gennari Date: Fri, 7 Apr 2006 09:14:26 +0000 Subject: [PATCH] gst/asfdemux/gstasfdemux.c: Send newsegment event only once per pad, fixes #336550. Original commit message from CVS: Patch by: Fabrizio Gennari * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event), (gst_asf_demux_push_buffer): Send newsegment event only once per pad, fixes #336550. --- ChangeLog | 8 ++++++++ common | 2 +- gst/asfdemux/gstasfdemux.c | 12 +++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index df693c1362..d9a5e2ec5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-07 Tim-Philipp Müller + + Patch by: Fabrizio Gennari + + * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event), + (gst_asf_demux_push_buffer): + Send newsegment event only once per pad, fixes #336550. + 2006-04-01 Thomas Vander Stichele * docs/plugins/gst-plugins-ugly-plugins-docs.sgml: diff --git a/common b/common index 623fe1c2cc..1783855e98 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 623fe1c2cce45bc30d5823c05716349874ae994e +Subproject commit 1783855e983a5294434673694e8a57e44980b6f1 diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 108d5be2ca..370aa4da97 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -135,6 +135,7 @@ gst_asf_demux_sink_event (GstPad * pad, GstEvent * event) demux = GST_ASF_DEMUX (gst_pad_get_parent (pad)); + GST_LOG_OBJECT (demux, "handling %s event", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT:{ GstFormat newsegment_format; @@ -1749,13 +1750,18 @@ gst_asf_demux_push_buffer (GstASFDemux * demux, asf_stream_context * stream, /* do we need to send a newsegment event? */ if (stream->need_newsegment) { - GST_DEBUG ("sending new-segment event on pad %s", - GST_PAD_NAME (stream->pad)); + GST_DEBUG ("sending new-segment event on pad %s: %" GST_TIME_FORMAT " - %" + GST_TIME_FORMAT, GST_PAD_NAME (stream->pad), + GST_TIME_ARGS (demux->segment.start), + GST_TIME_ARGS (demux->segment.stop)); /* FIXME: if we need to send a newsegment event on this pad and * the buffer doesn't have a timestamp, should we just drop the buffer * and wait for one with a timestamp before sending it? */ - gst_asf_demux_send_event_unlocked (demux, gst_event_new_new_segment (FALSE, demux->segment.rate, GST_FORMAT_TIME, demux->segment.start, demux->segment.stop, demux->segment.start)); /* last parameter isn't right */ + /* FIXME: last parameter in newsegment isn't right, is it?! */ + gst_pad_push_event (stream->pad, + gst_event_new_new_segment (FALSE, demux->segment.rate, GST_FORMAT_TIME, + demux->segment.start, demux->segment.stop, demux->segment.start)); stream->need_newsegment = FALSE; }