Commit 9a16fb5d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/rtp/gstbasertpdepayload.*: We need to send a newsegment event for...

gst-libs/gst/rtp/gstbasertpdepayload.*: We need to send a newsegment event for each instance, not just for the first ...

Original commit message from CVS:
Reviewed by: Tim-Philipp Müller  <tim at centricular dot net>
* 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).
parent 6f1277ab
2005-11-08 Sebastien Cote <sebas642 at yahoo dot ca>
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
* 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 <msmith@fluendo.com>
 
* ext/ogg/gstoggmux.c: (gst_ogg_mux_request_new_pad),
......
......@@ -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) =
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment