diff --git a/ChangeLog b/ChangeLog index ceef9e6414..81d9fca9cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-11-08 Sebastien Cote + + Reviewed by: Tim-Philipp Müller + + * gst-libs/gst/rtp/gstbasertpdepayload.c: + (gst_base_rtp_depayload_init), + (gst_base_rtp_depayload_set_gst_timestamp): + * gst-libs/gst/rtp/gstbasertpdepayload.h: + We need to send a newsegment event for each instance, not + just for the first instance of this class (get rid of + static variable in function). (#321011). + 2005-11-08 Michael Smith * ext/ogg/gstoggmux.c: (gst_ogg_mux_request_new_pad), diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c index 02b37c8ff3..ac4153d050 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.c +++ b/gst-libs/gst/rtp/gstbasertpdepayload.c @@ -154,6 +154,7 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter, gpointer g_class) filter->queue = g_queue_new (); filter->queue_delay = RTP_QUEUE_DELAY; + filter->need_newsegment = TRUE; /* this one needs to be overwritten by child */ filter->clock_rate = 0; @@ -291,8 +292,6 @@ static void gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter, guint32 timestamp, GstBuffer * buf) { - static gboolean first = TRUE; - guint64 ts = ((timestamp * GST_SECOND) / filter->clock_rate); /* rtp timestamps are based on the clock_rate @@ -306,14 +305,14 @@ gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter, GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); /* if this is the first buf send a discont */ - if (first) { + if (filter->need_newsegment) { /* send discont */ GstEvent *event = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_TIME, - ts, GST_CLOCK_TIME_NONE, 0); + GST_BUFFER_TIMESTAMP (buf), GST_CLOCK_TIME_NONE, 0); gst_pad_push_event (filter->srcpad, event); - first = FALSE; - GST_DEBUG_OBJECT (filter, "Pushed discont on this first buffer"); + filter->need_newsegment = FALSE; + GST_DEBUG_OBJECT (filter, "Pushed newsegment event on this first buffer"); } /* add delay to timestamp */ GST_BUFFER_TIMESTAMP (buf) = diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.h b/gst-libs/gst/rtp/gstbasertpdepayload.h index e79309883d..320da0765b 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.h +++ b/gst-libs/gst/rtp/gstbasertpdepayload.h @@ -81,7 +81,10 @@ struct _GstBaseRTPDepayload GstClock *clock; /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; + union { + gboolean need_newsegment; + gpointer _gst_reserved[GST_PADDING-1+1]; + }; }; struct _GstBaseRTPDepayloadClass