From dcd6da202ec36dc108030d97875a84bc7b30fbe4 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 27 May 2002 04:17:57 +0000 Subject: update to deal with events and set timestamps properly Original commit message from CVS: update to deal with events and set timestamps properly --- gst/speed/filter.func | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'gst/speed/filter.func') diff --git a/gst/speed/filter.func b/gst/speed/filter.func index cf23725b..867a825d 100644 --- a/gst/speed/filter.func +++ b/gst/speed/filter.func @@ -1,5 +1,6 @@ /* -*- Mode: c; c-basic-offset: 2 -*- */ _FORMAT *in_data, *out_data; + static gint64 offset = 0, timestamp = 0; /* get a buffer here so that we can have something to interpolate * against for the first few samples if speed < 0.5 */ @@ -22,6 +23,9 @@ out_data = (_FORMAT*) GST_BUFFER_DATA(out); } nout = GST_BUFFER_SIZE(out) / sizeof(_FORMAT); + GST_BUFFER_TIMESTAMP (out) = timestamp; + offset += nout; + timestamp = offset * GST_SECOND / filter->rate; for (j=0; jsinkpad); - while (GST_IS_EVENT(in)) { - switch (GST_EVENT_TYPE(in)) { - case GST_EVENT_EOS: - gst_element_set_eos((GstElement*)filter); - gst_pad_push(filter->srcpad, in); - return; - default: - gst_pad_push(filter->srcpad, in); - in = gst_pad_pull (filter->sinkpad); - } + while (GST_IS_EVENT (in)) { + gst_pad_event_default (filter->srcpad, GST_EVENT (in)); + in = gst_pad_pull (filter->sinkpad); } in_data = (_FORMAT*) GST_BUFFER_DATA(in); -- cgit v1.2.1